using UnityEngine;
using System;
using System.Collections;


public abstract class IElementalCommand
{
    public abstract void Execute(ShipController ship, Direction direction);
    public AudioClip clip;
}

public class DudCommand : IElementalCommand
{
    public override void Execute(ShipController ship, Direction direction) {  }
}

public class MoveCommand : IElementalCommand
{
	private float _speedFactor = 1f;
	public override void Execute(ShipController ship, Direction direction)
	{
        Debug.Log("executing a move command");
		if (direction == Direction.Clockwise) {
			 ship.Left(_speedFactor);
		} else if (direction == Direction.CounterClockwise) {
            ship.Right(_speedFactor);
		} 
	}
	public MoveCommand SpeedFactor(float factor)
	{
		_speedFactor = factor;
		return this;
	}
}

public class TurboCommand : IElementalCommand
{
    public override void Execute(ShipController ship, Direction direction) 
    {
        float turboBoost = 6f;
        if (direction == Direction.Clockwise)
        {
            ship.Left(turboBoost);
        }
        else if (direction == Direction.CounterClockwise)
        {
            ship.Right(turboBoost);
        } 

    }
}

public class SpinoutCommand : IElementalCommand
{
    public override void Execute(ShipController ship, Direction direction) 
    {  

    }
}

public class FireWeaponCommand : IElementalCommand
{
	private int _weaponType;
	private Element _elementalType;
    public override void Execute(ShipController ship, Direction direction)
	{
		ship.FireWeapon(_weaponType,_elementalType);
	}
	public FireWeaponCommand WeaponType(int type)
	{
		_weaponType = type;
		return this;
	}
	public FireWeaponCommand ElementalType(Element type)
	{
		_elementalType = type;
		return this;
	}
}

public class HealCommand : IElementalCommand
{
    public override void Execute(ShipController ship, Direction direction) 
    {
        PlayerHealth.Instance.DamageAll(-.04f);
    }
}

public class HurtCommand : IElementalCommand
{
    public override void Execute(ShipController ship, Direction direction) 
    {
        PlayerHealth.Instance.DamageAll(.02f);
    }
}

public class AttractRepulseCommand : IElementalCommand
{
    public override void Execute(ShipController ship, Direction direction) 
    {

    }
}

public class ShieldCommand : IElementalCommand
{
    public override void Execute(ShipController ship, Direction direction) 
    {

    }
}



