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