/// <summary> /// Gets the player's action in the current state. /// </summary> /// <returns>The <see cref="PlayerAction"/> containing the action of the player in the current state.</returns> public PlayerAction GetAction() { var action = new PlayerAction { Movement = Vector.GetSum(SteeringBehaviorsManager.GetAccelerationVector(), Movement), Kick = KickVector }; return(action); }
/// <summary> /// Initializes a new instance of the <see cref="Player"/> class. /// </summary> /// <param name="player">The football player.</param> /// <param name="footballAI">The <see cref="FsmAI"/> instance to which this player belongs.</param> protected Player(FootballPlayer player, FsmAI footballAI) : base(player.Id) { AI = footballAI; Position = player.Position; Movement = player.Movement; KickVector = player.KickVector; Speed = player.Speed; KickPower = player.KickPower; Possession = player.Possession; Precision = player.Precision; SteeringBehaviorsManager = new SteeringBehaviorsManager(this); }