using ActionGame.GameArtifacts.Intelligence.NonPlayerCharacterMovement;
using ActionGame.GameArtifacts.Models.Characters;
using ActionGame.GameArtifacts.Models.Game;
using ActionGame.GameResources.Models;
using ActionGame.RawResources.Manager;
using System;

namespace ActionGame.GameArtifacts.Factories
{
    public class MovementFactory
    {
        private GameData gameData;

        public MovementFactory(GameData gameData)
        {
            this.gameData = gameData;
        }


        public INonPlayerCharacterMovement GetMovement(Int32 movementKey, ICharacter character)
        {
            INonPlayerCharacterMovement movement = null;

            if (movementKey == (Int32)MovementTypes.NoMotion_Up) movement = new NoMotionMovement(NoMotionMovement.Direction.Up, character);
            else if (movementKey == (Int32)MovementTypes.NoMotion_Down) movement = new NoMotionMovement(NoMotionMovement.Direction.Down, character);
            else if (movementKey == (Int32)MovementTypes.NoMotion_Left) movement = new NoMotionMovement(NoMotionMovement.Direction.Left, character);
            else if (movementKey == (Int32)MovementTypes.NoMotion_Right) movement = new NoMotionMovement(NoMotionMovement.Direction.Right, character);
            else if (movementKey == (Int32)MovementTypes.SlowRandom) movement = new SlowRandomMotion(character);
            else if (movementKey == (Int32)MovementTypes.FastRandom) movement = new FastRandomMotion(character);
            else if (movementKey == (Int32)MovementTypes.BossStrafeFaceLeft) movement = new BossStrafeMovement(character, Operators.ObjectMover.Direction.Left);
            else if (movementKey == (Int32)MovementTypes.BossStrafeFaceRight) movement = new BossStrafeMovement(character, Operators.ObjectMover.Direction.Right);
            else if (movementKey == (Int32)MovementTypes.MirrorPlayer) movement = new MirrorPlayerMovement(character, gameData.GameState.Player);
            else if (movementKey == (Int32)MovementTypes.Teleport) movement = new TeleportMovement(character, gameData);

            return movement;
        }

    }
}
