public List <Koma> GetBoardKomaList(PlayerType player) { return(KomaList.Where(x => x.Player == player && x.IsOnBoard).ToList()); }
public GameState Clone() { return(new GameState(KomaList.Select(x => x.Clone()).ToList(), TurnPlayer, GameResult)); }
public List <Koma> GetKomaList(PlayerType player) { return(KomaList.Where(x => x.Player == player).ToList()); }
public BoardPositions BoardPositions(PlayerType player) { return(new BoardPositions(KomaList.Where(x => x.Player == player && x.IsOnBoard).Select(x => x.BoardPosition).ToList())); }
public Koma FindHandKoma(PlayerType player, KomaType komaType) { return(KomaList.FirstOrDefault(x => x.Player == player && x.IsInHand && x.KomaType == komaType)); }
public Koma FindBoardKoma(BoardPosition fromPosition) { return(KomaList.FirstOrDefault(x => x.BoardPosition == fromPosition)); }
public Koma FindKingOnBoard(PlayerType player) { // [MEMO:プレイヤーの王は盤上に1つのみあることを前提] return(KomaList.FirstOrDefault(x => x.Player == player && x.KomaType.IsKing && x.IsOnBoard)); }