コード例 #1
0
ファイル: tile_geometry.py プロジェクト: sn862/Gloom
 def do_rooms_overlap(room_a: AbstractRoomCard,
                      room_b: AbstractRoomCard) -> bool:
     for tile_a in room_a.get_tiles():
         for tile_b in room_b.get_tiles():
             if tile_a.has_same_coordinates(tile_b):
                 return True
     return False
コード例 #2
0
 def __init__(self):
     AbstractRoomCard.__init__(self, "Crossroads")
     self.add_tile(UniqueDungeonCardValues.ENTRANCE_B, -2, -3)
     self.add_tile(DungeonCardValues.EMPTY, -1, -3)
     self.add_tile(DungeonCardValues.EMPTY, 0, -3)
     self.add_tile(DungeonCardValues.EMPTY, 1, -3)
     self.add_tile(NumberedRoomTileValues.NINE, 2, -3)
     self.add_tile(DungeonCardValues.EMPTY, 3, -3)
     self.add_tile(NumberedRoomTileValues.SEVEN, 4, -3)
     self.add_tile(UniqueDungeonCardValues.EXIT_B, 5, -3)
     self.add_tile(DungeonCardValues.EMPTY, -2, -2)
     self.add_tile(DungeonCardValues.EMPTY, -1, -2)
     self.add_tile(NumberedRoomTileValues.FOUR, 0, -2)
     self.add_tile(NumberedRoomTileValues.FIVE, 1, -2)
     self.add_tile(DungeonCardValues.EMPTY, 2, -2)
     self.add_tile(NumberedRoomTileValues.EIGHT, 3, -2)
     self.add_tile(NumberedRoomTileValues.SIX, 4, -2)
     self.add_tile(NumberedRoomTileValues.THREE, 0, -1)
     self.add_tile(DungeonCardValues.OBSTACLE, 1, -1)
     self.add_tile(DungeonCardValues.EMPTY, -1, 0)
     self.add_tile(DungeonCardValues.EMPTY, 0, 0)
     self.add_tile(DungeonCardValues.EMPTY, 1, 0)
     self.add_tile(DungeonCardValues.EMPTY, -1, 1)
     self.add_tile(NumberedRoomTileValues.TEN, 0, 1)
     self.add_tile(DungeonCardValues.EMPTY, -2, 2)
     self.add_tile(NumberedRoomTileValues.ONE, -1, 2)
     self.add_tile(NumberedRoomTileValues.ELEVEN, 0, 2)
     self.add_tile(NumberedRoomTileValues.TWO, -2, 3)
     self.add_tile(NumberedRoomTileValues.TWELVE, -1, 3)
コード例 #3
0
 def __init__(self):
     AbstractRoomCard.__init__(self, "Road")
     self.add_tile(UniqueDungeonCardValues.ENTRANCE_A, -2, 4)
     self.add_tile(NumberedRoomTileValues.TWELVE, -1, -3)
     self.add_tile(NumberedRoomTileValues.TEN, -1, -2)
     self.add_tile(DungeonCardValues.OBSTACLE, -1, -1)
     self.add_tile(NumberedRoomTileValues.NINE, -1, 0)
     self.add_tile(NumberedRoomTileValues.SIX, -1, 1)
     self.add_tile(DungeonCardValues.EMPTY, -1, 2)
     self.add_tile(DungeonCardValues.EMPTY, -1, 3)
     self.add_tile(DungeonCardValues.EMPTY, -1, 4)
     self.add_tile(NumberedRoomTileValues.ELEVEN, 0, -3)
     self.add_tile(DungeonCardValues.EMPTY, 0, -2)
     self.add_tile(DungeonCardValues.OBSTACLE, 0, -1)
     self.add_tile(NumberedRoomTileValues.ONE, 0, 0)
     self.add_tile(NumberedRoomTileValues.FIVE, 0, 1)
     self.add_tile(NumberedRoomTileValues.FOUR, 0, 2)
     self.add_tile(DungeonCardValues.EMPTY, 0, 3)
     self.add_tile(UniqueDungeonCardValues.ENTRANCE_B, 0, 4)
     self.add_tile(DungeonCardValues.EMPTY, 1, -4)
     self.add_tile(NumberedRoomTileValues.SEVEN, 1, -3)
     self.add_tile(NumberedRoomTileValues.EIGHT, 1, -2)
     self.add_tile(NumberedRoomTileValues.THREE, 1, -1)
     self.add_tile(NumberedRoomTileValues.TWO, 1, 0)
     self.add_tile(DungeonCardValues.EMPTY, 1, 1)
     self.add_tile(DungeonCardValues.EMPTY, 1, 2)
     self.add_tile(DungeonCardValues.EMPTY, 1, 3)
     self.add_tile(UniqueDungeonCardValues.EXIT_A, 2, -1)
コード例 #4
0
 def __init__(self):
     AbstractRoomCard.__init__(self, "DeadEnd")
     self.add_tile(UniqueDungeonCardValues.ENTRANCE_A, -3, 1)
     self.add_tile(DungeonCardValues.EMPTY, -2, -1)
     self.add_tile(DungeonCardValues.EMPTY, -2, 0)
     self.add_tile(DungeonCardValues.EMPTY, -2, 1)
     self.add_tile(NumberedRoomTileValues.EIGHT, -2, -2)
     self.add_tile(DungeonCardValues.EMPTY, -1, -2)
     self.add_tile(DungeonCardValues.EMPTY, -1, -1)
     self.add_tile(DungeonCardValues.EMPTY, -1, 0)
     self.add_tile(NumberedRoomTileValues.SEVEN, -1, 1)
     self.add_tile(NumberedRoomTileValues.NINE, -1, 2)
     self.add_tile(NumberedRoomTileValues.TWO, 0, -3)
     self.add_tile(DungeonCardValues.EMPTY, 0, -2)
     self.add_tile(DungeonCardValues.EMPTY, 0, -1)
     self.add_tile(DungeonCardValues.EMPTY, 0, 0)
     self.add_tile(DungeonCardValues.OBSTACLE, 0, 1)
     self.add_tile(DungeonCardValues.EMPTY, 0, 2)
     self.add_tile(DungeonCardValues.EMPTY, 1, -4)
     self.add_tile(NumberedRoomTileValues.ONE, 1, -3)
     self.add_tile(NumberedRoomTileValues.THREE, 1, -2)
     self.add_tile(DungeonCardValues.OBSTACLE, 1, 0)
     self.add_tile(DungeonCardValues.EMPTY, 1, 1)
     self.add_tile(DungeonCardValues.OBSTACLE, 1, 2)
     self.add_tile(NumberedRoomTileValues.FIVE, 2, -5)
     self.add_tile(DungeonCardValues.EMPTY, 2, -4)
     self.add_tile(DungeonCardValues.EMPTY, 2, -3)
     self.add_tile(DungeonCardValues.EMPTY, 2, 0)
     self.add_tile(NumberedRoomTileValues.TEN, 2, 1)
     self.add_tile(DungeonCardValues.EMPTY, 2, 2)
     self.add_tile(UniqueDungeonCardValues.EXIT_A, 3, -6)
     self.add_tile(NumberedRoomTileValues.FOUR, 3, -5)
     self.add_tile(NumberedRoomTileValues.SIX, 3, -4)
     self.add_tile(NumberedRoomTileValues.ELEVEN, 3, 0)
     self.add_tile(NumberedRoomTileValues.TWELVE, 3, 1)
コード例 #5
0
ファイル: alcove.py プロジェクト: sn862/Gloom
 def __init__(self):
     AbstractRoomCard.__init__(self, "Alcove")
     self.add_tile(UniqueDungeonCardValues.EXIT_B, 0, -5)
     self.add_tile(DungeonCardValues.EMPTY, -1, -4)
     self.add_tile(DungeonCardValues.EMPTY, 0, -4)
     self.add_tile(DungeonCardValues.EMPTY, 1, -5)
     self.add_tile(NumberedRoomTileValues.EIGHT, -1, -3)
     self.add_tile(NumberedRoomTileValues.SEVEN, 0, -3)
     self.add_tile(NumberedRoomTileValues.NINE, 1, -4)
     self.add_tile(NumberedRoomTileValues.SIX, -1, -2)
     self.add_tile(NumberedRoomTileValues.ONE, 0, -2)
     self.add_tile(DungeonCardValues.OBSTACLE, 1, -3)
     self.add_tile(DungeonCardValues.EMPTY, -1, -1)
     self.add_tile(DungeonCardValues.EMPTY, 0, -1)
     self.add_tile(DungeonCardValues.EMPTY, 1, -2)
     self.add_tile(DungeonCardValues.EMPTY, -1, 0)
     self.add_tile(DungeonCardValues.EMPTY, 0, 0)
     self.add_tile(DungeonCardValues.EMPTY, 1, -1)
     self.add_tile(UniqueDungeonCardValues.ENTRANCE_B, -1, 1)
     self.add_tile(DungeonCardValues.EMPTY, 0, 1)
     self.add_tile(NumberedRoomTileValues.TWO, 1, 0)
     self.add_tile(DungeonCardValues.OBSTACLE, 1, 1)
     self.add_tile(NumberedRoomTileValues.THREE, 2, -1)
     self.add_tile(DungeonCardValues.OBSTACLE, 2, 0)
     self.add_tile(NumberedRoomTileValues.TWELVE, 2, 1)
     self.add_tile(NumberedRoomTileValues.FOUR, 3, -1)
     self.add_tile(NumberedRoomTileValues.TEN, 3, 0)
     self.add_tile(DungeonCardValues.EMPTY, 3, 1)
     self.add_tile(NumberedRoomTileValues.FIVE, 4, -1)
     self.add_tile(NumberedRoomTileValues.ELEVEN, 4, 0)
     self.add_tile(DungeonCardValues.EMPTY, 4, 1)
     self.add_tile(DungeonCardValues.EMPTY, 5, -1)
コード例 #6
0
 def __init__(self):
     AbstractRoomCard.__init__(self, "Clearing")
     self.add_tile(DungeonCardValues.EMPTY, -1, -3)
     self.add_tile(NumberedRoomTileValues.FIVE, 0, -3)
     self.add_tile(NumberedRoomTileValues.FOUR, 1, -3)
     self.add_tile(NumberedRoomTileValues.TWELVE, 2, -3)
     self.add_tile(DungeonCardValues.EMPTY, 3, -3)
     self.add_tile(DungeonCardValues.EMPTY, -1, -2)
     self.add_tile(DungeonCardValues.EMPTY, 0, -2)
     self.add_tile(DungeonCardValues.EMPTY, 1, -2)
     self.add_tile(NumberedRoomTileValues.ELEVEN, 2, -2)
     self.add_tile(DungeonCardValues.EMPTY, -2, -1)
     self.add_tile(DungeonCardValues.EMPTY, -1, -1)
     self.add_tile(NumberedRoomTileValues.SIX, 0, -1)
     self.add_tile(DungeonCardValues.EMPTY, 1, -1)
     self.add_tile(NumberedRoomTileValues.TEN, 2, -1)
     self.add_tile(UniqueDungeonCardValues.ENTRANCE_B, -3, 0)
     self.add_tile(DungeonCardValues.EMPTY, -2, 0)
     self.add_tile(DungeonCardValues.EMPTY, -1, 0)
     self.add_tile(DungeonCardValues.EMPTY, 0, 0)
     self.add_tile(DungeonCardValues.EMPTY, 1, 0)
     self.add_tile(UniqueDungeonCardValues.EXIT_B, 2, 0)
     self.add_tile(DungeonCardValues.EMPTY, -3, 1)
     self.add_tile(DungeonCardValues.EMPTY, -2, 1)
     self.add_tile(NumberedRoomTileValues.THREE, -1, 1)
     self.add_tile(DungeonCardValues.EMPTY, 0, 1)
     self.add_tile(NumberedRoomTileValues.SEVEN, 1, 1)
     self.add_tile(DungeonCardValues.EMPTY, -3, 2)
     self.add_tile(DungeonCardValues.EMPTY, -2, 2)
     self.add_tile(DungeonCardValues.EMPTY, -1, 2)
     self.add_tile(NumberedRoomTileValues.EIGHT, 0, 2)
     self.add_tile(DungeonCardValues.EMPTY, -4, 3)
     self.add_tile(NumberedRoomTileValues.TWO, -3, 3)
     self.add_tile(NumberedRoomTileValues.ONE, -2, 3)
     self.add_tile(NumberedRoomTileValues.NINE, -1, 3)
     self.add_tile(DungeonCardValues.EMPTY, 0, 3)
コード例 #7
0
ファイル: conftest.py プロジェクト: sn862/Gloom
def create_test_constructed_room():
    return ConstructedRoom(AbstractRoomCard("foo"), Frigid())
コード例 #8
0
ファイル: conftest.py プロジェクト: sn862/Gloom
def create_test_room():
    return AbstractRoomCard("foo")