Exemplo n.º 1
0
 public static RoomData DefineCell(int x, int y, RoomData.Type type)
 {
     if (GetRoomAtGridPosition(x, y, true) == null)
     {
         RoomData data = new RoomData(new Vector2(x, y), type);
         rooms.Add(data);
         return data;
     }
     else
     {
         GetRoomAtGridPosition(x, y, true).type = type;
         return GetRoomAtGridPosition(x, y, true);
     }
 }
Exemplo n.º 2
0
 public static RoomData DefineCell(Vector2 gridPos, RoomData.Type type)
 {
     return DefineCell((int)gridPos.X, (int)gridPos.Y, type);
 }
Exemplo n.º 3
0
 public static RoomData DefineCellFromWorldPos(Vector2 worldPosition, RoomData.Type type)
 {
     Vector2 gridp = PathfindConstants.WorldToGrid(worldPosition);
     return DefineCell(gridp, type);
 }