Class CommanderUnit
java.lang.Object
edu.ntnu.idatt2001.carljgu.battle.units.Unit
edu.ntnu.idatt2001.carljgu.battle.units.specialized.CavalryUnit
edu.ntnu.idatt2001.carljgu.battle.units.specialized.CommanderUnit
Class CommanderUnit that inherits from CavalryUnit.
CommanderUnit objects does not implement methods from
the superclass Unit as they are defined in CavalryUnit.
- Version:
- 1.4 01.05.2022
- Author:
- Carl Gützkow
-
Constructor Summary
ConstructorDescriptionCommanderUnit
(String name, int health) Instantiates a new CommanderUnit unit with a simplified constructor.CommanderUnit
(String name, int health, int attack, int armor) Instantiates a new CommanderUnit unit. -
Method Summary
Methods inherited from class edu.ntnu.idatt2001.carljgu.battle.units.specialized.CavalryUnit
getAttackBonus, getResistBonus
-
Constructor Details
-
CommanderUnit
Instantiates a new CommanderUnit unit. Uses the constructor of its superclass CavalryUnit- Parameters:
name
- String - a short name of the unit that can't be left with whitespace or empty.health
- int - HP - amount of health unit has. If it hits zero or more, the unit is dead.attack
- int - damage done, excluding attack bonus, on an enemy unit.armor
- int - damage resisted, excluding resist bonus, from an enemy unit.
-
CommanderUnit
Instantiates a new CommanderUnit unit with a simplified constructor. Attack is set to 25 and health is set to 15 Uses the constructor of its superclass CavalryUnit since the constructor gives no other value.- Parameters:
name
- String - a short name of the unit that can't be left with whitespace or empty.health
- int - HP - amount of health unit has. If it hits zero or more, the unit is dead.
-