Example #1
0
 public LogicalTile(Tile[] tiles)
 {
     this.tiles = tiles;
 }
Example #2
0
 public static bool checkSWCorner(Tile tile, Tile[] nearby)
 {
     return nearby[6] != tile;
 }
Example #3
0
 public static Tile[] getNearbyTiles(Map m, int i, int j, int layer)
 {
     Tile[] nearby = new Tile[9];
     int count = 0;
     for (int y = j - 1; y <= j + 1; ++y) {
         for (int x = i - 1; x <= i + 1; ++x) {
             if (x >= 0 && y >= 0 && x < m.width && y < m.height)
                 nearby[count] = m.tiles[x, y, layer];
             else
                 nearby[count] = m.tiles[i, j, layer];
             ++count;
         }
     }
     return nearby;
 }
Example #4
0
 public LogicalTile this[uint i, uint j]
 {
     get {
         Tile[] tiles = new Tile[Layers];
         for (int l = 0; l < Layers; ++l)
             tiles[l] = this.tiles[i, j, l];
         return new LogicalTile(tiles);
     }
 }