コード例 #1
0
ファイル: Match.cs プロジェクト: anekawamasayuki/OOPShogi
        public void Init()
        {
            Console.WriteLine("Shogi#Init() called");
            // TODO: 誰がPieceをNewするのか?誰がPieceインスタンスを管理するのか?Pieceインスタンスの総数は固定したい
            BPiece gold = PieceFactory.MakePiece(EPieceSort.kGold, true);
            BPiece king = PieceFactory.MakePiece(EPieceSort.kKing, false);

            Board.Drop(gold, new Coord(8, 4));
            Board.Drop(king, new Coord(0, 4));
            Turn.Switch();
        }
コード例 #2
0
ファイル: Match.cs プロジェクト: anekawamasayuki/OOPShogi
 private void MainLoop()
 {
     while (!this.IsMatchOver())
     {
         _textRenderer.RenderPosition(this);
         Command command;
         command = this.AskCommand();
         Console.WriteLine($"{GetPlayer(Turn).Name} command: {command}");
         History.Add(new HistoryEvent(command));
         Turn.Switch();
     }
 }