fix
This commit is contained in:
+5
-5
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user