using ActionGame.GameArtifacts.Models.Characters;
using ActionGame.GameArtifacts.Operators;
using Microsoft.Xna.Framework;


namespace ActionGame.GameArtifacts.Intelligence.NonPlayerCharacterMovement
{
    public class NoMotionMovement : INonPlayerCharacterMovement
    {
        public enum Direction { Up, Down, Left, Right };

        private Direction direction;
        private ICharacter character;


        public NoMotionMovement(Direction direction, ICharacter character)
        {
            this.direction = direction;
            this.character = character;
        }


        public void Act(GameTime gameTime)
        {
            if((direction == Direction.Up) && (character.CharacterSet.CurrentFrame != GameResources.Models.CharacterSet.Frame.Up))
            {
                character.CharacterSet.CurrentFrame = GameResources.Models.CharacterSet.Frame.Up;
            }
            else if ((direction == Direction.Down) && (character.CharacterSet.CurrentFrame != GameResources.Models.CharacterSet.Frame.Down))
            {
                character.CharacterSet.CurrentFrame = GameResources.Models.CharacterSet.Frame.Down;
            }
            else if ((direction == Direction.Left) && (character.CharacterSet.CurrentFrame != GameResources.Models.CharacterSet.Frame.Left))
            {
                character.CharacterSet.CurrentFrame = GameResources.Models.CharacterSet.Frame.Left;
            }
            else if ((direction == Direction.Right) && (character.CharacterSet.CurrentFrame != GameResources.Models.CharacterSet.Frame.Right))
            {
                character.CharacterSet.CurrentFrame = GameResources.Models.CharacterSet.Frame.Right;
            }
        }


        public void PostMovementAct(GameTime gameTime)
        {

        }


    }
}
