Customizeable Characters
September 11th, 2012
Background
Antifreeze Entertainment is coming up with their newest MMORPG "NeverQuest". They have realized that an important aspect to the game is customizable characters and have hired you for the job. Antifreeze requires their customers to be able to change three aspects of their character, HeadGear, UpperBodyGear, LowerBodyGear.
Requirements
You will have to write 8 classes for this assignment, as well as a GearTester.java file, which will be used to test your created objects. The classes you will have to write MUST HAVE the same exact names as listed.
You are required to have COMMENTS (JavaDoc Style) on your files. If you are unsure of how this would look, do not be afraid to ask us and we will post an example on the web page or to the mailing list.
You are also required to have a GearTester.java file, in which you will have to create at least 3 different instances of CharacterGear, with different properties to the others. You can reuse some of your HeadGear, UpperBodyGear and LowerBodyGear objects when creating your different CharacterGear objects
As you progress with this assignment, you will notice that there are many things in common between certain objects. We will learn more about how to fuse these things in common and make better design decisions in next weeks lab, this is called inheritance. Do not use inheritance (IE extends) for this lab. DO NOT USE INHERITANCE FOR THIS LAB. We will use it for next lab.
Specifics
- It does not have a name (String)
- It does not have a defense field (int)
- The getStats() method for this class SHOULD CALL the getStats() method for HeadGear, UpperBodyGear and LowerBodyGear in that order. You can use String concatanation to return the composition of the three strings as a single string. You should split up each item as within the output section.
--- Head Gear --- Name: BroHat Def: 2
- It does not have a name (String)
- It does not have a defense field (int)
- The getStats() method for this class SHOULD CALL the getStats() method for TorsoGear and ArmGear in that order. You can use String concatanation to return the composition of the two strings as a single string. Your output should look like this for UpperBody:
--- Upper Body Gear --- - Torso Gear - Name: Shirt of Doom Def: 50 StaminaDecrease: 78 - Arm Gear - Name: Bear Arms Def: 555 StaminaDecrease: 43
- staminaDecrease which is a RANDOM NUMBER (int) between 1 and 100, assigned upon creation of a unique instance of either Torso or Arm Gear. This should be done at construction. THIS IS NOT A PARAMETER PASSED IN FOR THE CREATION OF THE OBJECT.
- The getStats() method should ALSO add the string "StaminaDecrese: VAL". Where VAL is the value of the staminaDecrease for the particular item. Your output should look like this for either TorsoGear or ArmGear:
Name: Bear Arms Def: 555 StaminaDecrease: 53
- It does not have a name (String)
- It does not have a defense field (int)
- The getStats() method for this class SHOULD CALL the getStats() method for LegGear and FootGear in that order. You can use String concatanation to return the composition of the two strings as a single string. Your output should look like this for LowerBody:
--- Lower Body Gear --- - Leg Gear - Name: Tight Jeans Def: 1 SpeedIncrease: 2.4 - Foot Gear - Name: Birkenstock Sandals Def: 2 SpeedIncrease: 4.8
- speedIncrease which is a double computed as the defense * 2.4
- The getStats() method should ALSO add the string "SpeedIncrease: VAL". Where VAL is the value of the speedIncrease for the particular item. THIS IS NOT A PARAMETER PASSED IN FOR THE CREATION OF THE OBJECT. Your output should look like this for either LegGear or FootGear:
Name: Tight Jeans Def: 1 SpeedIncrease: 2.4
You will have to come up with your own constructors. Remember what each Class requires in order to be created.