diff --git a/src/Home.tsx b/src/Home.tsx index a43af49..7017d9d 100644 --- a/src/Home.tsx +++ b/src/Home.tsx @@ -151,7 +151,7 @@ const Home: FunctionComponent<{ initial?: number }> = ({ initial = 0 }) => { context.rtmt.sendMessage(channel_leave_game, {}); }; - const onHoleSelect = (index: number, pit: Pit) => { + const onPitSelect = (index: number, pit: Pit) => { //TODO : stoneCount comes from view model! if (pit.stoneCount === 0) { //TODO : warn user @@ -210,7 +210,7 @@ const Home: FunctionComponent<{ initial?: number }> = ({ initial = 0 }) => { boardId={boardId} boardViewModel={boardViewModel} context={context} - onHoleSelect={onHoleSelect} + onPitSelect={onPitSelect} /> )} diff --git a/src/animation/PitAnimator.ts b/src/animation/PitAnimator.ts index 016f9c1..b6168b7 100644 --- a/src/animation/PitAnimator.ts +++ b/src/animation/PitAnimator.ts @@ -172,7 +172,7 @@ export default class PitAnimator { const theme = this.context.themeManager.theme; const stoneCount = pit.stoneCount; const stoneColor = theme.stoneColor; - const pitColor = theme.holeColor; + const pitColor = theme.pitColor; const id = pit.index.toString(); return PitViewModelFactory.create({ id, diff --git a/src/components/BoardView.tsx b/src/components/BoardView.tsx index a00f7a4..7d51291 100644 --- a/src/components/BoardView.tsx +++ b/src/components/BoardView.tsx @@ -29,7 +29,7 @@ function range(size: number) { return ans; } -const HoleView: FunctionComponent<{ +const PitView: FunctionComponent<{ pitViewModel: PitViewModel; onClick: () => void; }> = ({ pitViewModel, onClick }) => { @@ -112,23 +112,23 @@ const BoardView: FunctionComponent<{ boardId: string; boardViewModel: BoardViewModel; userKey: string; - onHoleSelect: (index: number, hole: Pit) => void; -}> = ({ game, context, boardId, boardViewModel, userKey, onHoleSelect }) => { + onPitSelect: (index: number, pit: Pit) => void; +}> = ({ game, context, boardId, boardViewModel, userKey, onPitSelect: onPitSelect }) => { const createPitView = (key: any, pitViewModel: PitViewModel, onClick: () => void) => { - return ; + return ; }; const player1Pits = game?.board.player1Pits.map((pit, index) => { const pitViewModel = boardViewModel.pits[pit.index]; return createPitView(index, pitViewModel, () => { if (game.turnPlayerId === game.player1Id) - onHoleSelect(game.board.player1Pits.indexOf(pit), pit); + onPitSelect(game.board.player1Pits.indexOf(pit), pit); }); }); const player2Pits = game!!.board.player2Pits.map((pit, index) => { const pitViewModel = boardViewModel.pits[pit.index]; return createPitView(index, pitViewModel, () => { if (game.turnPlayerId === game.player2Id) - onHoleSelect(game.board.player2Pits.indexOf(pit), pit); + onPitSelect(game.board.player2Pits.indexOf(pit), pit); }); }); const theme = context.themeManager.theme; diff --git a/src/components/HeaderBar.tsx b/src/components/HeaderBar.tsx index 058d8f5..253c51e 100644 --- a/src/components/HeaderBar.tsx +++ b/src/components/HeaderBar.tsx @@ -13,7 +13,7 @@ function renderNewGameButton(context: Context, game: MancalaGame, onNewGameClick