Beispiel #1
0
 public void Stop()
 {
     Army.Stop();
     Army = null;
 }
Beispiel #2
0
 // 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;
 }
Beispiel #3
0
 // Construtors
 public Player(String name)
 {
     Name = name;
     Army = new Army(this);
 }
Beispiel #4
0
 // Constructors
 public Group(Army army)
 {
     Army = army;
     Liberties = 0;
     Army.AddGroup(this);
 }