public Orc(MonsterState state, IMonsterBehavior hostileBehavior, IMonsterBehavior neutralBehavior) { Hitpoints = 100; Name = "Orc"; MonsterChar = 'O'; IsDead = false; Armor = ArmorType.Heavy; Weapon = WeaponType.Melee; CurrentState = state; Damage = 15; // SetBehavior(MonsterState.Hostile, hostileBehavior); SetBehavior(MonsterState.Neutral, neutralBehavior); }
public void SetBehavior(IMonsterBehavior behavior) { this.behavior = behavior ?? throw new ArgumentNullException("Invalid behavior", nameof(behavior)); }
public void SetBehavior(MonsterState state, IMonsterBehavior behavior) { Behaviors[state] = behavior; }