func GetNpcByName(name string) types.NPC { id := db.FindOne(types.NpcType, bson.M{"name": utils.FormatName(name)}) if id != nil { return GetNpc(id) } return nil }
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 GetPlayerCharacterByName(name string) types.PC { id := db.FindOne(types.PcType, bson.M{"name": utils.FormatName(name)}) if id != nil { return GetPlayerCharacter(id) } return nil }
func GetSkillByName(name string) types.Skill { id := db.FindOne(types.SkillType, bson.M{"name": utils.FormatName(name)}) if id != nil { return GetSkill(id) } return nil }
func GetUserByName(username string) types.User { id := db.FindOne(types.UserType, bson.M{"name": utils.FormatName(username)}) if id != nil { return GetUser(id) } return nil }
func GetAreaByName(name string) types.Area { id := db.FindOne(types.AreaType, bson.M{"name": utils.FormatName(name)}) if id != nil { return GetArea(id) } return nil }
func StoreIn(roomId types.Id) types.Store { id := db.FindOne(types.StoreType, bson.M{"roomid": roomId}) if id != nil { return GetStore(id) } return nil }
func GetRoomByLocation(coordinate types.Coordinate, zoneId types.Id) types.Room { id := db.FindOne(types.RoomType, bson.M{ "zoneid": zoneId, "location": coordinate, }) if id != nil { return GetRoom(id) } return nil }