Esempio n. 1
0
        public void CountUpAroundTiles(ITileContents target)
        {
            var type = target.GetType();

            foreach (var tile in _aroundTiles)
            {
                if (!tile.ContentsMap.ContainsKey(type))
                {
                    tile.ContentsMap.Add(type, 0);
                }
                tile.ContentsMap[type]++;
            }
        }
Esempio n. 2
0
 public void SetContents(ITileContents contents, int index = 1)
 {
     for (int i = 0; i < index; i++)
     {
         var x    = UnityEngine.Random.Range(0, Width);
         var y    = UnityEngine.Random.Range(0, Height);
         var tile = Map[y, x].GetComponent <Tile>();
         if (tile.Contents.GetType() != typeof(None))
         {
             i--;
             continue;
         }
         tile.Contents = contents;
         tile.CountUpAroundTiles(contents);
     }
 }
Esempio n. 3
0
 public void ShowContents(ITileContents contents)
 {
     _contents.GetComponent <Image>().sprite = contents.Image;
 }