This commit is contained in:
root
2026-09-20 14:16:41 +02:00
parent 0798933b05
commit b6d1909d7f
56 changed files with 3752 additions and 1989 deletions
+5 -5
View File
@@ -1,9 +1,9 @@
package sim
import (
"wh/config"
"wh/fixed"
"wh/world"
"halcyon/config"
"halcyon/fixed"
"halcyon/world"
)
// tickCtx is per-tick shared context; asteroid positions are computed lazily
@@ -81,11 +81,11 @@ func axis(v fixed.Vec, port, base uint16, conv func(fixed.F) int32) int32 {
func (b *shipBus) In(port uint16) int32 {
sh, tc := b.sh, b.tc
switch {
case port == PortTick:
case port == PortTurn:
return int32(tc.tick)
case port == PortDay:
return sat32(tc.s.Day)
case port == PortTicks:
case port == PortTurns:
return int32(tc.cfg.TicksPerDay)
case port >= PortPosX && port <= PortPosZ:
return axis(sh.Pos, port, PortPosX, kmInt)
+2 -2
View File
@@ -6,9 +6,9 @@ package sim
// +X towards +Y and elevation (pitch) up from the XY plane towards +Z.
const (
// System.
PortTick = 0x00 // in: tick within the current day
PortTurn = 0x00 // in: turn within the current day
PortDay = 0x01 // in: day number
PortTicks = 0x02 // in: ticks per day
PortTurns = 0x02 // in: turns per day
// Navigation (relative to the star).
PortPosX = 0x10
+3 -3
View File
@@ -4,9 +4,9 @@ import (
"math"
"testing"
"wh/config"
"wh/fixed"
"wh/vm"
"halcyon/config"
"halcyon/fixed"
"halcyon/vm"
)
func testCfg() config.Config {
+5 -5
View File
@@ -5,11 +5,11 @@ package sim
import (
"fmt"
"wh/config"
"wh/fixed"
"wh/market"
"wh/vm"
"wh/world"
"halcyon/config"
"halcyon/fixed"
"halcyon/market"
"halcyon/vm"
"halcyon/world"
)
// Hull describes the physical properties of a ship design.
+4 -4
View File
@@ -4,10 +4,10 @@ import (
"fmt"
"sort"
"wh/config"
"wh/fixed"
"wh/vm"
"wh/world"
"halcyon/config"
"halcyon/fixed"
"halcyon/vm"
"halcyon/world"
)
// RunDay simulates one full day, mutating the state, and returns the result.