Example #1
0
        public void GenerateItem(EnvItem item)
        {
            int x, y;

            do
            {
                x = r.Next(1, Width - 1);
                y = r.Next(1, Height - 1);
            } while (prostredie[y][x].id != Cesta.Tag || (x == 8 && y >= 5) || (y == 1) || (y == 5));

            // prepis novou polozkou sveta
            prostredie[y][x] = item;
        }
Example #2
0
 public void NahradObjekty(int tag, EnvItem item)
 {
     for (int y = 0; y < prostredie.Length; y++)
     {
         for (int x = 0; x < prostredie[y].Length; x++)
         {
             if (prostredie[y][x].id == tag)
             {
                 prostredie[y][x] = item;
             }
         }
     }
 }