Example #1
0
 public Tile(int x, int y, int z, TileType type)
 {
     _x = x;
     _y = y;
     _z = z;
     _type = type;
 }
Example #2
0
        private void LoadStructure(Field field, TileType type, string path)
        {
            string[] lines = File.ReadAllLines(path);

            if (lines.Length % 2 != 0)
                throw new Exception("Invalid odd tile count!");

            foreach (string line in lines)
            {
                string[] splitted = line.Split(' ');
                if (splitted.Length != 3) continue;
                Tile tile = new Tile(int.Parse(splitted[0]), int.Parse(splitted[1]), int.Parse(splitted[2]), type);
                field.Add(tile);
            }
        }