Module sneak.berlin/go/rogue, package game: - types.go: all rogue.h constants, flag types, Coord/Stats/Room/ObjInfo - creature.go/object.go: the THING union split into Creature (Player/ Monster) and Object; slices replace the C linked lists - level.go: Place map with the C column-major layout and chat/flat/moat/ winat access methods - tables.go: extern.c + init.c data (bestiary, item tables, name pools) - rng.go: the exact C LCG (seed*11109+13849), golden-tested against a compiled C reference for seed compatibility - init.go: per-game item appearance randomization (init.c) - daemon.go/daemons.go: scheduler with DaemonID replacing function pointers (ids match the C save format's mapping) - game.go: RogueGame holds all former globals; NewGame constructor
18 lines
552 B
Go
18 lines
552 B
Go
package game
|
|
|
|
// daemons.c — the daemon and fuse callbacks. Each callback is ported in the
|
|
// phase that owns its subsystem; runDaemon is the dispatch switch that
|
|
// replaces the C function pointers.
|
|
|
|
// runDaemon invokes the callback named by id (the call through d_func in C).
|
|
func (g *RogueGame) runDaemon(id DaemonID, arg int) {
|
|
_ = arg
|
|
switch id {
|
|
default:
|
|
// Callbacks are added to this switch as their subsystems are
|
|
// ported; reaching one that isn't here is a porting bug, not a
|
|
// game state.
|
|
panic("daemon not yet ported")
|
|
}
|
|
}
|