code wiki / (root) / nx_actor_role_game_logic.nx

nx_actor_role_game_logic.nx

buildroot/runtime/nx_actor_role_game_logic.nx

6116 B171 linesdepth 4pulls 6 transitivereach 3 importersview sourcekind librarytopic actor
docsdependenciesstructsconstsfunctions

about

nx_actor_role_game_logic.nx -- game-logic actor role. Wraps [[nx_tictactoe]] (other-agent / sibling-arc game primitive) as a cooperative actor. Each step plays ONE ply: the configured AI picks a move for the current side, applies it, evaluates outcome, fans out a GAME_ACTION message. Actor COMPLETED when game ends (WIN / DRAW). V1 ships tic-tac-toe; the same adapter shape will wrap nx_checkers + future game primitives in subsequent versions. Lighter transitive import set than the image grader -- composes cleanly with the LLM + audio adapters in a quad-companion smoke per [[feedback-nxc2-module-const-ceiling]] guidance.

dependencies 6 imports · 3 importers

nx_syscalls.nx nx_tier.nx nx_prng.nx nx_tictactoe.nx nx_actor.nx nx_message.nx nx_actor_role_game_logic.nx nx_actor_role_game_logic_test.nx nx_quad_companion_compose_test.nx nx_quad_real_emit_test.nx

imports: nx_syscalls.nxnx_tier.nxnx_prng.nxnx_tictactoe.nxnx_actor.nxnx_message.nx

imported by: nx_actor_role_game_logic_test.nxnx_quad_companion_compose_test.nxnx_quad_real_emit_test.nx

structs

34struct NxGameLogicCtx

consts

24const NX_GL_V_STEPPED: nx_int = 0
25const NX_GL_V_COMPLETED: nx_int = 1
26const NX_GL_V_FAILED_PICK: nx_int = 2
27const NX_GL_V_FAILED_APPLY: nx_int = 3
28const NX_GL_V_INVALID: nx_int = 4
29const NX_GL_V_NULL: nx_int = 5
30const NX_GL_V_N: nx_int = 6
46const NX_GL_CTX_BYTES: nx_int = 72 // 9 fields * 8

functions

50func nx_gl_v_is_valid(v: nx_int) -> nx_int
called by 1: main
56func nx_gl_difficulty_is_valid(d: nx_int) -> nx_int
called by 2: nx_gl_actor_newmain
65func nx_gl_actor_new(first_mover: nx_int,
91func nx_gl_actor_step(ctx: *NxGameLogicCtx,
142func nx_gl_actor_outcome(ctx: *NxGameLogicCtx) -> nx_int
called by 3: mainmainmain
147func nx_gl_actor_winner(ctx: *NxGameLogicCtx) -> nx_int
called by 1: main calls 1: nx_ttt_winner
152func nx_gl_actor_plies(ctx: *NxGameLogicCtx) -> nx_int
called by 2: mainmain
157func nx_gl_actor_last_move(ctx: *NxGameLogicCtx) -> nx_int
called by 1: main
162func nx_gl_actor_last_side(ctx: *NxGameLogicCtx) -> nx_int
167func nx_gl_actor_is_done(ctx: *NxGameLogicCtx) -> nx_int
called by 1: main