예제 #1
0
 public static void FillAllTiles <T> (ITilezoneTileDataStream tiles, int index, TileFunctionDelegate <T> TileFunc, T arg, bool writeEmptyTiles = false)
 {
     for (int x = 0; x < tiles.width; x++)
     {
         for (int y = 0; y < tiles.height; y++)
         {
             Tile newTile = TileFunc(x, y, arg);
             if (writeEmptyTiles || newTile != Tile.empty)
             {
                 tiles[x, y, index] = newTile;
             }
         }
     }
 }
예제 #2
0
 public static void FillTiles <T1, T2, T3> (int x, int y, int width, int height, ITilezoneTileDataStream tiles, int index, TileFunctionDelegate <T1, T2, T3> TileFunc, T1 arg1, T2 arg2, T3 arg3, bool useLocalCoordinates, bool writeEmptyTiles = false)
 {
     for (int xx = 0; xx < width; xx++)
     {
         for (int yy = 0; yy < height; yy++)
         {
             Tile newTile = useLocalCoordinates ? TileFunc(xx, yy, arg1, arg2, arg3) : TileFunc(x + xx, y + yy, arg1, arg2, arg3);
             if (writeEmptyTiles || newTile != Tile.empty)
             {
                 tiles[x + xx, y + yy, index] = newTile;
             }
         }
     }
 }