feat: add currentPlayer to prompt
This commit is contained in:
@@ -113,7 +113,8 @@ registration.add('turn <player>', async function(cmd) {
|
||||
return `No ${pieceType}s left in ${player}'s supply.`;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
this.context.value.currentPlayer
|
||||
);
|
||||
const [player, row, col, type] = playCmd.params as [PlayerType, number, number, PieceType?];
|
||||
const pieceType = type === 'cat' ? 'cat' : 'kitten';
|
||||
@@ -141,7 +142,8 @@ registration.add('turn <player>', async function(cmd) {
|
||||
const part = availableKittens.find(p => `${p.position[0]},${p.position[1]}` === posKey);
|
||||
if (!part) return `No kitten at (${row}, ${col}).`;
|
||||
return null;
|
||||
}
|
||||
},
|
||||
this.context.value.currentPlayer
|
||||
);
|
||||
const [row, col] = graduateCmd.params as [number, number];
|
||||
const part = availableKittens.find(p => p.position[0] === row && p.position[1] === col)!;
|
||||
|
||||
@@ -73,7 +73,8 @@ registration.add('turn <player> <turn:number>', async function(cmd) {
|
||||
return `Cell (${row}, ${col}) is already occupied.`;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
},
|
||||
this.context.value.currentPlayer
|
||||
);
|
||||
const [player, row, col] = playCmd.params as [PlayerType, number, number];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user