示例#1
0
文件: Game.cs 项目: davidajulio/hx
 public void Stop()
 {
     Army.Stop();
     Army = null;
 }
示例#2
0
文件: Game.cs 项目: davidajulio/hx
 // Constructors
 public Piece(GoInterface.PieceRepresentation pieceRepresentation, Army army, PiecePosition position)
 {
     this.army = army;
     this.pieceRepresentation = pieceRepresentation;
     this.position = position;
     if(army.LastPlay == position)
     {
         throw new PieceException(this, "Invalid place.");
     }
     int liberties = CheckNeighbours();
     if(!IsValidPosition(liberties))
     {
         RollbackChanges();
         throw new PieceException(this, "Invalid place.");
     }
     CommitChanges(liberties);
     army.LastPlay = position;
 }
示例#3
0
文件: Game.cs 项目: davidajulio/hx
 // Construtors
 public Player(String name)
 {
     Name = name;
     Army = new Army(this);
 }
示例#4
0
文件: Game.cs 项目: davidajulio/hx
 // Constructors
 public Group(Army army)
 {
     Army = army;
     Liberties = 0;
     Army.AddGroup(this);
 }