classDiagram
class Character {
-String name
-int healthPoint
-int manaPoint
-int defense
+takeDamage(int) void
+setDefense(int) void
+useMana(int) void
+isAlive() boolean
}
class Action {
<<interface>>
+execute(Character, Character) void
}
class AttackAction {
-int MIN_DAMAGE
-int MAX_DAMAGE
-Random random
+execute(Character, Character) void
}
class DefenseAction {
-int MIN_DEFENSE
-int MAX_DEFENSE
-Random random
+execute(Character, Character) void
}
class SkillAction {
<<abstract>>
#int manaCost
#int coolTime
#int remainingCooltime
#Random random
+SkillAction(manaCost, coolTime)
+reduceCoolTime() void
+execute(Character, Character) void
}
class CutTwice {
-int MIN_DAMAGE
-int MAX_DAMAGE
-int MANA_COST
-int COOL_TIME
+CutTwice()
+execute(Character, Character) void
}
class CutThreeTimes {
-int MIN_DAMAGE
-int MAX_DAMAGE
-int MANA_COST
-int COOL_TIME
+CutThreeTimes()
+execute(Character, Character) void
}
class PowerStrike {
-int MIN_DAMAGE
-int MAX_DAMAGE
-int MANA_COST
-int COOL_TIME
+PowerStrike()
+execute(Character, Character) void
}
Action <|.. AttackAction : implements
Action <|.. DefenseAction : implements
Action <|.. SkillAction : implements
SkillAction <|-- CutTwice : extends
SkillAction <|-- CutThreeTimes : extends
SkillAction <|-- PowerStrike : extends