INNER CODE UNIT · TypeScript
decks
Thorium-Sim/thorium · server/classes/generic/index.ts:256
const decks = App.decks.filter(d => d.simulatorId === this.simulatorId);
const rooms = App.rooms.filter(r => this.locations.indexOf(r.id) > -1);
const crew = App.crew.filter(c => c.simulatorId === this.simulatorId);
//
// Gather Information
//
// Get the damage team positions
const damageTeamCrew = crew
.map(c => c.position)
.filter(c => damagePositions.indexOf(c) > -1)
.filter((c, i, a) => a.indexOf(c) === i);
const damageTeamCrewCount = crew
.filter(c => damagePositions.indexOf(c.position) > -1)
.reduce((prev, next) => {
prev[next.position] = prev[next.position] ? prev[next.position] + 1 : 1;
return prev;