Professional Documents
Culture Documents
Password: YImVMKjuTk
Version 3
In this quiz, we will modify the structure of the game to set the foundation for the following
potential change.
2 Weapon
You need to add the following enum to your code:
Name: Weapon
Package: model.collectibles
Type: Enum
Description: An enum representing the type of weapon that can be owned by a player. Possible
values are: ARMGUN, RANGED, MELEE .
3 Supply
You need to add the following design to your code for class Supply:
3.1 SubClasses
There are two types of supplies, Defensive and Empowering. Each supply type should be
represented as a separate subclass of Supply. You need to add the following Class to your code:
3.2 Defensive
1. Name: Defensive
Package: model.collectibles
Type: Class
Description: A class representing the Supply type that can be owned by a player.
All the class attributes are READ and WRITE unless otherwise specified.
Attributes:
boolean shield: attribute used to indicate whether the player is shielded against zombie attacks or not. The
default value is false.
Weapon weapon: enum attribute which shows the current weapon owned by the player during each turn.
3.3 Constructors
Defensive(Weapon weapon): constructor that initializes the attributes of the Defensive
object.
3.4 Empowering
2. Name: Empowering
Package: model.collectibles
Type: Class
Description: A class representing the Supply type that can be owned by a player.
Attributes:
int coins: attribute used to retrieve Action points per turn for the player. The default value is 50. This
attribute is READ ONLY.
int fullPower: attribute used to inflict damage to the zombie’s HP per turn. The default value is 100. This
attribute is READ ONLY.
3.5 Constructors
Empowering( ): constructor that initializes the attributes of the Empowering object.