(tankId: TankId)
| 9 | import { explosionFromTank } from './common/destroyTanks' |
| 10 | |
| 11 | function* handleTankPickPowerUps(tankId: TankId) { |
| 12 | const { tanks, powerUps }: State = yield select() |
| 13 | const tank = tanks.get(tankId) |
| 14 | const powerUp = powerUps.find(p => testCollide(asRect(p, -0.5), asRect(tank))) |
| 15 | |
| 16 | if (powerUp) { |
| 17 | yield put(actions.pickPowerUp(yield select(selectors.playerName, tankId), tank, powerUp)) |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | export default function* playerTankSaga(playerName: PlayerName, tankId: TankId) { |
| 22 | const { hit: hitAction }: { hit: actions.Hit } = yield race({ |
nothing calls this directly
no test coverage detected