using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using StrategicCombat.Shots;

namespace StrategicCombat.CombatUnits
{
    /// <summary>
    /// This class represent a president on the right side of the board.
    /// </summary>
    public class RightPresident : RightCombatUnit
    {

        #region Constructors

        /// <summary>
        /// Create a new president that is positioned to the right on a board.
        /// </summary>
        /// <param name="content"></param>
        public RightPresident(ContentManager content, Vector2 position)
            : base(content, position)
        {
            // Load textures.
            this.boardUnitTexture = content.Load<Texture2D>("CombatUnits/RightCombatUnits/RightPresident75");
            this.combatUnitTexture = content.Load<Texture2D>("CombatUnits/RightCombatUnits/RightPresident50");
            this.shotTexture = content.Load<Texture2D>("Textures/whiteTile");

            // Set movement restriction
            this.movementRestriction = new Vector2(7, 7);

            // Set the movement speed
            this.movementSpeed = 2;

            // Set the rotationspeed.
            this.rotationSpeedPc = 0.009f;
            this.rotationSpeedXbox = 0.09f;

            // Set the shot speed
            this.shotSpeed = 13f;
            this.healthDamage = 200;
            this.shotDelay = 60;
            this.shotDelayCounter = 0;

            // Set delay for movement sound.
            this.movementDelay = 26;
            this.movementDelayCounter = 0;

            // Set the health value to 100.
            this.health = 500;

        }

        #endregion

        #region Methods

        /// <summary>
        /// Add a shot to the list of shots.
        /// </summary>
        public override void AddShot()
        {
            // Add a shot.
            this.shots.Add(new Shot(this.combatPosition + this.combatDirection * (this.frameSizeCombat.X / 2), this.combatDirection,
                this.shotSpeed, new Point(2, 2), true, 0, false, false));

        } // End of the AddShot method.

        /// <summary>
        /// Play a movement sound.
        /// </summary>
        public override void PlayMovementSound()
        {
            Program.soundBank.PlayCue("soldierMovement");

        } // End of the PlayMovementSound method.

        /// <summary>
        /// Play a shooting sound.
        /// </summary>
        public override void PlayShootingSound()
        {
            Program.soundBank.PlayCue("presidentShot");

        } // End of the PlayShootingSound method.

        #endregion

    } // End of class

} // End of namespace
