Exemple #1
0
 private PutResult putTile(SquareTile tile, int[,] room, Coord coord)
 {
     if (room[coord.X, coord.Y] > 0)
     {
         return(PutResult.Busy);
     }
     if (coord.X + tile.Size > ROOM_SIZE || coord.Y + tile.Size > ROOM_SIZE)
     {
         return(PutResult.TooBig);
     }
     for (var x = coord.X; x < coord.X + tile.Size; x++)
     {
         for (var y = coord.Y; y < coord.Y + tile.Size; y++)
         {
             if (room[x, y] > 0)
             {
                 return(PutResult.TooBig);
             }
             room[x, y] = tile.Size;
         }
     }
     return(PutResult.Ok);
 }
Exemple #2
0
 private PutResult putTile(SquareTile tile, int[,] room, Coordinate coord)
 {
     if (room[coord.X, coord.Y] > 0)
     {
         return PutResult.Busy;
     }
     if (coord.X + tile.Size > ROOM_SIZE || coord.Y + tile.Size > ROOM_SIZE)
     {
         return PutResult.TooBig;
     }
     for (var x = coord.X; x < coord.X + tile.Size; x++)
     {
         for (var y = coord.Y; y < coord.Y + tile.Size; y++)
         {
             if (room[x, y] > 0)
             {
                 return PutResult.TooBig;
             }
             room[x, y] = tile.Size;
         }
     }
     return PutResult.Ok;
 }