Skip to content

isCommand beta ​

Function of @v12-engine/engine

ts
export declare function isCommand<K extends Command['type']>(command: PlayerCommand, type: K): command is Extract<WithoutPlayer<Command>, {
    type: K;
}>;

Whether a command is one of the engine's of a kind, narrowed to its shape (isCommand(sent, 'order'): its units and its order): what reads a command it did not write, a game's own (ModCommand) passed over