COMP2396
|
The SecurityGuard is well-funded by the department and must use a SuperGun. More...
Public Member Functions | |
SecurityGuard (String name, int energyLevel, int skillLevel) | |
Constructs a new SecurityGuard with the specified name, energy level, and skill level. | |
void | boostWeapon (SuperGun w1) |
Boosts the specified SuperGun for the next attack. | |
![]() | |
Character (String name, int energyLevel, int skillLevel) | |
Constructs a new Character with the specified name, energy level, and skill level. | |
int | attack (Weapon w1) |
Calculates the total attack amount generated by the character. | |
int | getEnergyLevel () |
Returns the current energy level of the character. | |
String | getName () |
Returns the name of the character. | |
int | getSkillLevel () |
Returns the skill level of the character. | |
int | hurt (int attackAmount) |
Reduces the energy level of the character by the specified attack amount. | |
boolean | isLose () |
Determines whether the character has lost the combat. | |
The SecurityGuard is well-funded by the department and must use a SuperGun.
Only the guard knows how to boost the SuperGun. It is a subclass of the Character class and has the ability to boost a SuperGun.
Definition at line 8 of file SecurityGuard.java.
|
inline |
Constructs a new SecurityGuard with the specified name, energy level, and skill level.
name | the name of the security guard |
energyLevel | the initial energy level of the security guard |
skillLevel | the skill level of the security guard |
Definition at line 17 of file SecurityGuard.java.
References assignment2.Character.energyLevel, and assignment2.Character.skillLevel.
|
inline |
Boosts the specified SuperGun for the next attack.
w1 | the SuperGun to be boosted |
Definition at line 26 of file SecurityGuard.java.
References assignment2.SuperGun.boost().
Referenced by assignment2.OfficeCombat2.main().