Change spawn_rooms into a property instead of a method

This commit is contained in:
Ben 2019-06-21 01:42:44 +01:00
parent 59a26f6028
commit 7619f55b70
2 changed files with 4 additions and 3 deletions

View File

@ -176,7 +176,8 @@ class RoomCrumbsCollection(BaseCrumbsCollection):
super().__init__(model=Room,
key='id')
def get_spawn_rooms(self):
@property
def spawn_rooms(self):
return [room for room in self.values() if room.spawn]
async def setup_tables(self):

View File

@ -30,7 +30,7 @@ from houdini.data.permission import PermissionCrumbsCollection
try:
import uvloop
uvloop.install()
#uvloop.install()
except ImportError:
uvloop = None
@ -184,7 +184,7 @@ class Houdini:
self.logger.info('Loaded {} igloo flooring'.format(len(self.flooring)))
self.rooms = await RoomCrumbsCollection.get_collection()
self.spawn_rooms = self.rooms.get_spawn_rooms()
self.spawn_rooms = self.rooms.spawn_rooms
await self.rooms.setup_tables()
await self.rooms.setup_waddles()
self.logger.info('Loaded {} rooms ({} spawn)'.format(len(self.rooms), len(self.spawn_rooms)))