Beispiel #1
0
	public void SetNeighbour(NeighbourPos pos, Cell nb)
	{
		Neighbours [(int)pos] = nb; 
	}
Beispiel #2
0
	public int GetCoinCount (NeighbourPos pos)
	{
		if (Empty)
		{
			return 0;
		}

		Cell nb = Neighbours [(int)pos];

		if (nb == null)
		{
			return 0;
		}
		try
		{
			if (!nb.Empty && 
			    nb.CoinRef != null &&
			    nb.CoinRef.CoinId == CoinRef.CoinId)
			{
				return nb.GetCoinCount(pos) + 1;
			}
		}
		catch(Exception exc)
		{
			Debug.Log("Exception: " + exc.Message);
		}

		return 0;
	}