diff --git a/houdini/data/penguin.py b/houdini/data/penguin.py index 65afa55..9df5d7a 100644 --- a/houdini/data/penguin.py +++ b/houdini/data/penguin.py @@ -11,6 +11,7 @@ from houdini.data.ninja import CardCrumbsCollection from houdini.data.pet import PuffleCrumbsCollection, PuffleItemCrumbsCollection from houdini.data.buddy import BuddyListCollection, BuddyRequestCollection, CharacterBuddyCollection, \ IgnoreListCollection +from houdini.data.room import PenguinIglooRoomCollection class Penguin(db.Model): @@ -91,6 +92,7 @@ class Penguin(db.Model): self.inventory = None self.permissions = None self.igloos = None + self.igloo_rooms = None self.furniture = None self.flooring = None self.locations = None @@ -109,6 +111,7 @@ class Penguin(db.Model): self.inventory = await ItemCrumbsCollection.get_collection(self.id) self.permissions = await PermissionCrumbsCollection.get_collection(self.id) self.igloos = await IglooCrumbsCollection.get_collection(self.id) + self.igloo_rooms = await PenguinIglooRoomCollection.get_collection(self.id) self.furniture = await FurnitureCrumbsCollection.get_collection(self.id) self.flooring = await FlooringCrumbsCollection.get_collection(self.id) self.locations = await LocationCrumbsCollection.get_collection(self.id) diff --git a/houdini/data/room.py b/houdini/data/room.py index aedd778..a10c3b6 100644 --- a/houdini/data/room.py +++ b/houdini/data/room.py @@ -158,6 +158,16 @@ class PenguinIglooRoom(db.Model, RoomMixin): del p.server.igloos_by_penguin_id[self.penguin_id] +class PenguinIglooRoomCollection(BaseCrumbsCollection): + + def __init__(self, inventory_id=None): + super().__init__(model=PenguinIglooRoom, + key='id', + inventory_model=PenguinIglooRoom, + inventory_key='penguin_id', + inventory_value='id', + inventory_id=inventory_id) + class RoomTable(db.Model): __tablename__ = 'room_table'