-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: allow player name feat: style * fix: typecheck
- Loading branch information
Showing
24 changed files
with
670 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
import { BoardPiece } from '@kenrick95/c4' | ||
import { PlayerAi } from '@kenrick95/c4' | ||
import { BoardPiece, PlayerHuman, PlayerAi } from '@kenrick95/c4' | ||
import { GameLocal, initGameLocal } from './game-local' | ||
|
||
class GameLocalAi extends GameLocal {} | ||
export function initGameLocalAi() { | ||
return initGameLocal(GameLocalAi, new PlayerAi(BoardPiece.PLAYER_2)) | ||
export function initGameLocalAi(playerName: string) { | ||
const firstPlayer = new PlayerHuman(BoardPiece.PLAYER_1, playerName) | ||
const aiPlayer = new PlayerAi(BoardPiece.PLAYER_2, `AI Player`) | ||
return initGameLocal(GameLocalAi, firstPlayer, aiPlayer) | ||
} |
Oops, something went wrong.