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

public class BaseObject : NetworkBehaviour
{
	[SyncVar]
	public int side = 0;
	public bool alive = true;

	public GameForce gameForce
	{
		get { return Game.GetInstance().GetGameForceBySide(side); }
	}

	public bool isLocal
	{
		get { return side == Game.GetInstance().localPlayerSide; }
	}

	public bool isRemote
	{
		get { return !isLocal; }
	}

	public bool isHost
	{
		get { return side == 0; }
	}
		
	public virtual void Die()
	{
		alive = false;
		NetworkServer.Destroy(gameObject);
	}
}
