protected override IMonsterMotion GetMethodForDeterminingDirection(MonsterMobility mobility) { if (mobility != MonsterMobility.Stationary) { throw new ArgumentOutOfRangeException(); } return(null); }
protected override Func<Monster, World, Direction> GetMethodForDeterminingDirection(MonsterMobility mobility) { switch (mobility) { case MonsterMobility.Cautious: return MonsterMovement.DetermineDirectionCautious; default: throw new ArgumentOutOfRangeException(); } }
protected override IMonsterMotion GetMethodForDeterminingDirection(MonsterMobility mobility) { switch (mobility) { case MonsterMobility.Aggressive: return(GlobalServices.MonsterMovementFactory.SemiAggressive(this)); default: throw new ArgumentOutOfRangeException(); } }
protected override Func<Monster, World, Direction> GetMethodForDeterminingDirection(MonsterMobility mobility) { switch (mobility) { case MonsterMobility.Placid: return MonsterMovement.RandomDirection; case MonsterMobility.Aggressive: return MonsterMovement.DetermineDirectionSemiAggressive; default: throw new ArgumentOutOfRangeException(); } }
protected override Func<Monster, World, Direction> GetMethodForDeterminingDirection(MonsterMobility mobility) { switch (mobility) { case MonsterMobility.Placid: return MonsterMovement.DetermineDirectionRolling; case MonsterMobility.Patrolling: return MonsterMovement.DetermineDirectionStandardPatrolling; case MonsterMobility.Aggressive: Func<Monster, World, Direction> result = (m, w) => DetermineDirectionAggressive(this, w, ShouldMakeAnAggressiveMove); return result; default: throw new ArgumentOutOfRangeException(); } }
protected override IMonsterMotion GetMethodForDeterminingDirection(MonsterMobility mobility) { switch (mobility) { case MonsterMobility.Patrolling: { var result = GlobalServices.MonsterMovementFactory.PatrolPerimeter(this, this.InitialDirection); GlobalServices.Game.Services.RemoveService(typeof(PatrolPerimeter)); GlobalServices.Game.Services.AddService(typeof(PatrolPerimeter), result); return(result); } default: throw new ArgumentOutOfRangeException(); } }
protected override IMonsterMotion GetMethodForDeterminingDirection(MonsterMobility mobility) { switch (mobility) { case MonsterMobility.Patrolling: return(GlobalServices.MonsterMovementFactory.StandardPatrolling(this, this.InitialDirection)); case MonsterMobility.Placid: return(GlobalServices.MonsterMovementFactory.StandardRolling(this, this.InitialDirection)); case MonsterMobility.Aggressive: return(GlobalServices.MonsterMovementFactory.KillerCubeRedMovement(this)); default: throw new ArgumentOutOfRangeException(); } }
protected abstract Func<Monster, World, Direction> GetMethodForDeterminingDirection(MonsterMobility mobility);
protected override Func<Monster, World, Direction> GetMethodForDeterminingDirection(MonsterMobility mobility) { if (mobility != MonsterMobility.Static) throw new ArgumentOutOfRangeException(); return null; }
public MobilityAfterInjury(Monster monster, MonsterMobility mobilityToChangeTo) : base(monster) { this._mobilityToChangeTo = mobilityToChangeTo; }