Define Gun trait and WorldState type in Nim #166

Closed
opened 2026-09-19 14:39:01 +02:00 by SirStone · 1 comment
Owner

Question

Define the core Nim types: Gun concept/trait, WorldState object, FeedbackEvent object, and GunPrediction return type. Write common_libs/gun_harness/gun_interface.nim.

Based on decisions D1, D2, D12:

  • Gun.predict(state: WorldState, bulletSpeed: float): tuple[x, y: float]
  • Gun.onResult(event: FeedbackEvent)
  • WorldState holds: enemy (x, y, direction, speed, energy), self (x, y, direction, speed, energy, gunDir, gunHeat, radarDir), arena (width, height), tick
  • FeedbackEvent holds: tick, predictedX, predictedY, actualX, actualY, bulletPower
## Question Define the core Nim types: `Gun` concept/trait, `WorldState` object, `FeedbackEvent` object, and `GunPrediction` return type. Write `common_libs/gun_harness/gun_interface.nim`. Based on decisions D1, D2, D12: - Gun.predict(state: WorldState, bulletSpeed: float): tuple[x, y: float] - Gun.onResult(event: FeedbackEvent) - WorldState holds: enemy (x, y, direction, speed, energy), self (x, y, direction, speed, energy, gunDir, gunHeat, radarDir), arena (width, height), tick - FeedbackEvent holds: tick, predictedX, predictedY, actualX, actualY, bulletPower
SirStone added the wayfinder:task label 2026-09-19 14:39:01 +02:00
Author
Owner

Superseded by vertical-slice tickets — see map #165.

Superseded by vertical-slice tickets — see map #165.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SirStone/SirRoboGarage#166