Skip to content

Commit

Permalink
Merge f249451 into 6ad4955
Browse files Browse the repository at this point in the history
  • Loading branch information
McLaynV committed Jun 28, 2022
2 parents 6ad4955 + f249451 commit 2ea65e7
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/types.ts
Expand Up @@ -298,6 +298,13 @@ export interface PhaseMap<
[phaseName: string]: PhaseConfig<G, CtxWithPlugins>;
}

export type AiEnumerate = Array<
| { event: string; args?: any[] }
| { move: string; args?: any[] }
| ActionShape.MakeMove
| ActionShape.GameEvent
>;

export interface Game<
G extends any = any,
CtxWithPlugins extends Ctx = Ctx,
Expand Down Expand Up @@ -332,16 +339,7 @@ export interface Game<
playerView?: (G: G, ctx: CtxWithPlugins, playerID: PlayerID | null) => any;
plugins?: Array<Plugin<any, any, G>>;
ai?: {
enumerate: (
G: G,
ctx: Ctx,
playerID: PlayerID
) => Array<
| { event: string; args?: any[] }
| { move: string; args?: any[] }
| ActionShape.MakeMove
| ActionShape.GameEvent
>;
enumerate: (G: G, ctx: Ctx, playerID: PlayerID) => AiEnumerate;
};
processMove?: (
state: State<G, Ctx | CtxWithPlugins>,
Expand Down

0 comments on commit 2ea65e7

Please sign in to comment.