refactor(three-monks): Replace commands with phase wrappers
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { World, query, type Entity } from "../src/index";
|
||||
import { CommandQueue } from "../src/commands/index";
|
||||
import { generateRandomPlayLog } from "../examples/three-monks/random-playthrough";
|
||||
import {
|
||||
ActionCard,
|
||||
@@ -18,10 +17,6 @@ import {
|
||||
type ActionKind,
|
||||
type ToolKind,
|
||||
} from "../examples/three-monks/components";
|
||||
import {
|
||||
issueSelectAction,
|
||||
registerCommands,
|
||||
} from "../examples/three-monks/commands";
|
||||
import { createThreeMonksFlow } from "../examples/three-monks/gameflow";
|
||||
import {
|
||||
prepareNextRound,
|
||||
@@ -112,18 +107,17 @@ describe("Three Monks action selection", () => {
|
||||
expect(getSelectedAction(world, players[0])).toBe("rest");
|
||||
});
|
||||
|
||||
it("command selection notifies gameflow and completes the round once all players select", () => {
|
||||
it("behavior tree completes a round after all players select", () => {
|
||||
const { world, players } = setup();
|
||||
const commands = new CommandQueue(world);
|
||||
const flow = createThreeMonksFlow(world);
|
||||
registerCommands(world, commands, flow);
|
||||
|
||||
flow.start();
|
||||
flow.runner.tick();
|
||||
|
||||
for (const player of players) {
|
||||
issueSelectAction(world, player, "rest");
|
||||
commands.execute();
|
||||
selectAction(world, player, "rest");
|
||||
flow.notifySelectionChanged();
|
||||
flow.runner.tick();
|
||||
}
|
||||
|
||||
for (const player of players) {
|
||||
|
||||
Reference in New Issue
Block a user