﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Game1;

namespace Shooter
{
    class Player
    {
        //Animation representing the player
        public Texture2D PlayerTexture;

		//public Texture2D PlayerTexture
		public Animation PlayerAnimation;

        //VertexPosition of the Player
        public Vector2 Position;

        //State of the Player
        public bool Active;

        //Amount of hit points that player has
        public int Health;

        //Get the width of the player ship
        public int Width
        {
            get { return PlayerAnimation.FrameWidth; }
        }

        //Get the height of the player ship
        public int Height
        {
            get { return PlayerAnimation.FrameHeight; }
        }

        public void Initialize(Animation animation, Vector2 position)
        {
			PlayerAnimation = animation;

            //PlayerTexture = texture;

            Position = position;

            Active = true;

            Health = 100;
        }

        public void Update(GameTime gameTime)
        {


			PlayerAnimation.Position = Position;
			PlayerAnimation.Update(gameTime);
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            //spriteBatch.Draw(PlayerTexture, Position, null, Color.White, 0f, Vector2.Zero, 1f,
            //    SpriteEffects.None, 0f);

			PlayerAnimation.Draw(spriteBatch);
        }
    }
}