Example #1
0
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)
}
Example #2
0
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
}
Example #3
0
func GetStore(id types.Id) types.Store {
	return db.Retrieve(id, types.StoreType).(types.Store)
}
Example #4
0
func GetSkill(id types.Id) types.Skill {
	return db.Retrieve(id, types.SkillType).(types.Skill)
}
Example #5
0
func GetSpawner(id types.Id) types.Spawner {
	return db.Retrieve(id, types.SpawnerType).(types.Spawner)
}
Example #6
0
func GetNpc(id types.Id) types.NPC {
	return db.Retrieve(id, types.NpcType).(types.NPC)
}
Example #7
0
func GetPlayerCharacter(id types.Id) types.PC {
	return db.Retrieve(id, types.PcType).(types.PC)
}
Example #8
0
func GetItem(id types.Id) types.Item {
	return db.Retrieve(id, types.ItemType).(types.Item)
}
Example #9
0
func GetTemplate(id types.Id) types.Template {
	return db.Retrieve(id, types.TemplateType).(types.Template)
}
Example #10
0
func GetUser(id types.Id) types.User {
	return db.Retrieve(id, types.UserType).(types.User)
}
Example #11
0
func GetArea(id types.Id) types.Area {
	return db.Retrieve(id, types.AreaType).(types.Area)
}
Example #12
0
func GetZone(id types.Id) types.Zone {
	return db.Retrieve(id, types.ZoneType).(types.Zone)
}
Example #13
0
func GetRoom(id types.Id) types.Room {
	return db.Retrieve(id, types.RoomType).(types.Room)
}