Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Dear student, you woke up in a mystical and magical world. You feel a strange power flowing through the veins. You are a Planeswalker! You

Dear student, you woke up in a mystical and magical world. You feel a strange power flowing through the veins. You are a Planeswalker! You are now able to control mana and creatures, and since you are a good Python programmer, you decide to write a Python class that helps you in managing duels in the Magic the Gathering world. In this first exercise, you need to create 4 classes in order to manage the different types of cards.

The first class, namely the base class for cards, has to be named Card, and it must contain the following attributes: - Name of the card --> name, a string - Tap Status --> isTapped, boolean - Type of the card --> card_type, a string

The second class, namely the card that gives mana to a PlanesWalker, is called ManaCard, and inherits attributes and methods from the Card. In addition to the latter, it has the following attributes: - Card type --> card_type = 'mana', a string - How much mana the card gives to the planeswalker --> mana_qty, a integer number

The third class, namely the class that contains creatures data, must be called Creature, and also this class inherits attributes and methods from the Card. In addition to the latter, it has the following attributes: - Card type --> card_type = 'creature', a string - Mana cost to be casted --> mana_cost, an integer number - Attack Value --> attack, an integer number - Defense Value --> defense, an integer number

The last class is the Planeswalker class. It has to be named PlanesWalker, and it contains the following attributes: - Name of the PlanesWalker --> name, a string - Mana cards list --> mana, a list of mana cards - Creatures card list --> creatures, a list of creatures card - Quantity of mana available --> mana_qty, an integer number. This attribute is NOT PASSED AS ARGUMENT, and ITS DEFAULT VALUE IS 0.

Be sure to create a correct __init__ function for each of the classes and to correctly inherits data from the base class (if necessary).

'''

import mtg

if __name__ == "__main__": pass

"by using python"

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Flash XML Applications Use AS2 And AS3 To Create Photo Galleries Menus And Databases

Authors: Joachim Schnier

1st Edition

0240809173, 978-0240809175

More Books

Students also viewed these Databases questions

Question

What is k-fold cross-validation?

Answered: 1 week ago

Question

Discuss the role of job attitudes in explaining turnover intention.

Answered: 1 week ago

Question

4. Who should be invited to attend?

Answered: 1 week ago