Esempio n. 1
0
func GetAllSkills() types.SkillList {
	ids := db.FindAll(types.SkillType)
	skills := make(types.SkillList, len(ids))
	for i, id := range ids {
		skills[i] = GetSkill(id)
	}
	return skills
}
Esempio n. 2
0
func GetAreas(zone types.Zone) types.AreaList {
	ids := db.FindAll(types.AreaType)
	areas := make(types.AreaList, len(ids))
	for i, id := range ids {
		areas[i] = GetArea(id)
	}

	return areas
}
Esempio n. 3
0
func GetAllTemplates() types.TemplateList {
	ids := db.FindAll(types.TemplateType)
	templates := make(types.TemplateList, len(ids))
	for i, id := range ids {
		templates[i] = GetTemplate(id)
	}
	sort.Sort(templates)
	return templates
}
Esempio n. 4
0
func GetNpcs() types.NPCList {
	ids := db.FindAll(types.NpcType)
	npcs := make(types.NPCList, len(ids))

	for i, id := range ids {
		npcs[i] = GetNpc(id)
	}

	return npcs
}
Esempio n. 5
0
func GetSpawners() types.SpawnerList {
	ids := db.FindAll(types.SpawnerType)
	spawners := make(types.SpawnerList, len(ids))

	for i, id := range ids {
		spawners[i] = GetSpawner(id)
	}

	return spawners
}
Esempio n. 6
0
func GetZones() types.ZoneList {
	ids := db.FindAll(types.ZoneType)
	zones := make(types.ZoneList, len(ids))

	for i, id := range ids {
		zones[i] = GetZone(id)
	}

	return zones
}
Esempio n. 7
0
func GetRooms() types.RoomList {
	ids := db.FindAll(types.RoomType)
	rooms := make(types.RoomList, len(ids))

	for i, id := range ids {
		rooms[i] = GetRoom(id)
	}

	return rooms
}
Esempio n. 8
0
func GetUsers() types.UserList {
	ids := db.FindAll(types.UserType)
	users := make(types.UserList, len(ids))

	for i, id := range ids {
		users[i] = GetUser(id)
	}

	return users
}
Esempio n. 9
0
func GetOnlinePlayerCharacters() []types.PC {
	var pcs []types.PC

	for _, id := range db.FindAll(types.PcType) {
		pc := GetPlayerCharacter(id)
		if pc.IsOnline() {
			pcs = append(pcs, pc)
		}
	}

	return pcs
}
Esempio n. 10
0
func UserCount() int {
	return len(db.FindAll(types.UserType))
}