/// <summary> /// Initializes a new instance of the <see cref="PlayerStatus"/> class. /// </summary> /// <param name="player"><see cref="IPlayer"/></param> /// <param name="coordinate">Represents the player's default coordinate.</param> public PlayerStatus(IPlayer player, Coordinate curPoint, Coordinate halfDefault) { _player = player; _defenceStatus = new DefenceStatus(_player); _passStatus = new PassStatus(_player); SubState = new SubStateObj(); var side = player.Side; var position = player.Input.AsPosition; if (position == Position.Goalkeeper) { this.MoveRegion = PlayerRule.GetGoalKeeperMoveRegion(position, side); } else { this.MoveRegion = MoveRegionCache.GetMoveRegion(curPoint); if (side == Side.Away) { this.MoveRegion = this.MoveRegion.Mirror(); } } this._xPlusActiveRegion = PlayerRule.GetActiveRegion(true, this.MoveRegion); this._xMinusActiveRegion = PlayerRule.GetActiveRegion(false, this.MoveRegion); if (side == Side.Away) { curPoint = curPoint.Mirror(); halfDefault = halfDefault.Mirror(); } this.Default = curPoint; this.HalfDefault = halfDefault; this.Acceleration = PlayerRule.GetAcceleration(player.PropCore[PlayerProperty.Speed, 0, -1, false], player.PropCore[PlayerProperty.Acceleration, 0, -1, false]); this.MaxSpeed = PlayerRule.GetMaxSpeed(player.PropCore[PlayerProperty.Speed, 0, -1, false]); //this.Speed = PlayerRule.GetSpeed(player, this.MaxSpeed); this.Reset(); this.Redecide(); }
public static void Boot() { MoveRegionCache.Boot(); FormationCache.Boot(); StateInitializer.Initialize(); }