• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DaniSomoza / galactic-commander / 12457139241

22 Dec 2024 07:38PM UTC coverage: 52.086% (-13.5%) from 65.587%
12457139241

push

github

web-flow
Build units (#11)

* update models in game-engine

* added fleets

* add build unit service and troops page

* added build units dialog

* added build units queue

206 of 790 branches covered (26.08%)

Branch coverage included in aggregate %.

366 of 893 new or added lines in 84 files covered. (40.99%)

10 existing lines in 7 files now uncovered.

1417 of 2326 relevant lines covered (60.92%)

3.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.29
/packages/game-engine/src/engine/units/getPlayerUnit.ts
1
import { IPlayerDocument } from '../../models/PlayerModel'
2
import { IUnitDocument } from '../../models/UnitModel'
3
import { IPlanetDocument } from '../../models/PlanetModel'
4

5
function getPlayerUnit(
6
  player: IPlayerDocument,
7
  unitId: string,
8
  planet: IPlanetDocument
9
): IUnitDocument | undefined {
NEW
10
  const raceUnit = player.race.units.find((raceUnit) => raceUnit._id.toString() === unitId)
×
NEW
11
  const specialPlanetUnit = planet.units.find((planetUnit) => planetUnit._id.toString() === unitId)
×
12

NEW
13
  const unit = raceUnit || specialPlanetUnit
×
14

NEW
15
  return unit
×
16
}
17

18
export default getPlayerUnit
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc