using UnityEngine;
using System.Collections;

public class Game : MonoBehaviour {

	public World worldPrefab; // inspector
	public ClientWorld clientWorldPrefab; // inspector
	public Camera tempCamera; // inspector

	public networkController controller; // inspector

	public UILabel treasureCountLabel; //inspector
	public UILabel healthLabel; //inspector
	public UILabel clientTreasureCountLabel; // inspector
	public UILabel serverWaiting; // inspector
	public UILabel clientWaiting; // inspector

	private World world;
	private ClientWorld clientWorld;

	public bool splitScreen;

	// Use this for initialization
	void Start () {
		if (splitScreen) {
			StartServer (splitScreen);
		}
	}

	public void StartServer(bool splitScreen) {
		Debug.Log("StartServer");
		world = Instantiate (worldPrefab) as World;
		world.Init (this, splitScreen);
	}

	public void StartClient () {
		Debug.Log("StartClient");
		clientWorld = Instantiate (clientWorldPrefab) as ClientWorld;
		clientWorld.Init (this);
	}

	public World GetWorld() {
		return world;
	}

	public ClientWorld GetClientWorld() {
		return clientWorld;
	}
}
