using UnityEngine;
using System.Collections;
using System.Collections.Generic;

// Basically a massive RPC class.
public class NetworkedPlayer : MonoBehaviour {	

	// Hits

	// Editable attributes

	// Mass - Increase and Decrease
	// Gravity - Increase
	// Blind
	// Shape Change
	// Decoy
	// Flight Change

	#region messages to send

	[SerializeField]
	NetworkPlayerCommandButton[] buttons;
	

	public void IncreaseMass(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.MASS_CHANGE_COOLDOWN);
		networkView.RPC("ChangeMass", RPCMode.All, AddOnStats.MASS_AMOUNT_TO_ADD);
	}
	// We think need RPC function declarations here.

	public void DecreaseMass(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.MASS_CHANGE_COOLDOWN);
		networkView.RPC("ChangeMass", RPCMode.All, AddOnStats.MASS_AMOUNT_TO_REMOVE);
	}

	[RPC]
	void ChangeMass(float massChange)
	{

	}

	public void IncreaseGravity(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.GRAVITY_CHANGE_COOLDOWN);
		networkView.RPC("ChangeGravity", RPCMode.All, AddOnStats.GRAVITY_AMOUNT_TO_ADD);
	}

	public void DecreaseGravity(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.GRAVITY_CHANGE_COOLDOWN);
		networkView.RPC("ChangeGravity", RPCMode.All, -AddOnStats.GRAVITY_AMOUNT_TO_ADD);
	}

	[RPC]
	void ChangeGravity(float additionalGravityToAdd)
	{

	}

	public void OnBlindButtonPressed(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.BLIND_CHARGE_COOLDOWN);
		networkView.RPC ("BlindPlayer", RPCMode.All);
	}

	[RPC]
	void BlindPlayer()
	{

	}

	public void OnShapeChangeButton(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.SHAPE_CHANGE_COOLDOWN);
		networkView.RPC("ChangeShape", RPCMode.All);
	}

	[RPC]
	void ChangeShape()
	{

	}


	public void OnDecoyButtonPressed(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.DECOY_CHARGE_COOLDOWN);
		networkView.RPC("ActivateDecoy", RPCMode.All);
	}

	[RPC]
	void ActivateDecoy()
	{

	}

	public void OnChangeFlightButtOnPressed(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		networkView.RPC("ChangeFlight", RPCMode.All);
	}

	[RPC]
	void ChangeFlight()
	{

	}

	public void OnTeleportButtonPressed(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.TELEPORT_CHARGE_COOLDOWN);
		networkView.RPC("Teleport", RPCMode.All);
	}

	[RPC]
	void Teleport()
	{

	}

	public void OnRotateButtonPressed(NetworkPlayerCommandButton button)
	{
		//activeButtons.Add(button);
		button.SetNumberOfTaps(NetworkedPlayerButtonCooldowns.ROTATE_CHARGE_COOLDOWN);
		networkView.RPC ("Rotate", RPCMode.All);
	}

	[RPC]
	public void Rotate()
	{

	}

	public void OnButtonPressed(int buttonId)
	{
		networkView.RPC("SendButtonPress", RPCMode.All, buttonId);
	}

	[RPC]
	void SendButtonPress(int index)
	{
	}

	#endregion
	
}
