Example #1
0
File: Side.cs Project: kflu/cnchess
        public Side(Game game)
        {
            this.game = game;

            // Initialize pieces
            this.pieces = (from piece in this.game.Pieces where piece.Side == this select piece).ToArray();
            Debug.Assert(pieces.Length == 16);
            this.jiang = (Jiang)(from p in this.pieces where p.GetType() == jiang.GetType() select p).First();

            // Initialize Oppopent
            int i = Array.IndexOf(this.game.Sides, this);
            this.Opponent = this.game.Sides[Math.Abs(1 - i)]; // this = 1 then opponent = 0, and vice versa
        }
Example #2
0
File: Ju.cs Project: kflu/cnchess
 public Ju(Game game, Side side)
     : base(game, side)
 {
 }
Example #3
0
 public Board(Game game)
 {
     this.game = game;
     this.InitBoard();
     this.UpdatePiecePositionOnBoard();
 }