func GetWorld() types.World { id := db.FindOne(types.WorldType, bson.M{}) if id == nil { return db.NewWorld() } return db.Retrieve(id, types.WorldType).(types.World) }
func GetTemplateItems(templateId types.Id) types.ItemList { ids := db.Find(types.ItemType, bson.M{"templateid": templateId}) items := make(types.ItemList, len(ids)) for i, id := range ids { items[i] = db.Retrieve(id, types.ItemType).(types.Item) } return items }
func GetStore(id types.Id) types.Store { return db.Retrieve(id, types.StoreType).(types.Store) }
func GetSkill(id types.Id) types.Skill { return db.Retrieve(id, types.SkillType).(types.Skill) }
func GetSpawner(id types.Id) types.Spawner { return db.Retrieve(id, types.SpawnerType).(types.Spawner) }
func GetNpc(id types.Id) types.NPC { return db.Retrieve(id, types.NpcType).(types.NPC) }
func GetPlayerCharacter(id types.Id) types.PC { return db.Retrieve(id, types.PcType).(types.PC) }
func GetItem(id types.Id) types.Item { return db.Retrieve(id, types.ItemType).(types.Item) }
func GetTemplate(id types.Id) types.Template { return db.Retrieve(id, types.TemplateType).(types.Template) }
func GetUser(id types.Id) types.User { return db.Retrieve(id, types.UserType).(types.User) }
func GetArea(id types.Id) types.Area { return db.Retrieve(id, types.AreaType).(types.Area) }
func GetZone(id types.Id) types.Zone { return db.Retrieve(id, types.ZoneType).(types.Zone) }
func GetRoom(id types.Id) types.Room { return db.Retrieve(id, types.RoomType).(types.Room) }