COMP2396
Loading...
Searching...
No Matches
assignment2.SecurityGuard Class Reference

The SecurityGuard is well-funded by the department and must use a SuperGun. More...

Inheritance diagram for assignment2.SecurityGuard:
Collaboration diagram for assignment2.SecurityGuard:

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.
 
- Public Member Functions inherited from assignment2.Character
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SecurityGuard()

assignment2.SecurityGuard.SecurityGuard ( String name,
int energyLevel,
int skillLevel )
inline

Constructs a new SecurityGuard with the specified name, energy level, and skill level.

Parameters
namethe name of the security guard
energyLevelthe initial energy level of the security guard
skillLevelthe skill level of the security guard

Definition at line 17 of file SecurityGuard.java.

17 {
18 super(name, energyLevel, skillLevel);
19 }

References assignment2.Character.energyLevel, and assignment2.Character.skillLevel.

Member Function Documentation

◆ boostWeapon()

void assignment2.SecurityGuard.boostWeapon ( SuperGun w1)
inline

Boosts the specified SuperGun for the next attack.

Parameters
w1the SuperGun to be boosted

Definition at line 26 of file SecurityGuard.java.

26 {
27 w1.boost();
28 }

References assignment2.SuperGun.boost().

Referenced by assignment2.OfficeCombat2.main().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: