+/**
+ * Removes a piece from the board
+ * @param piece The piece to remove
+ * @returns true iff the piece actually existed
+ */
+bool Board::RemovePiece(Piece * piece)
+{
+ bool result = false;
+ for (int x = 0; x < width; ++x)
+ {
+ for (int y = 0; y < height; ++y)
+ {
+ if (board[x][y] == piece)
+ {
+ result = true;
+ board[x][y] = NULL;
+ }
+ }
+ }
+
+ vector<Piece*>::iterator i = pieces.begin();
+ while (i != pieces.end())
+ {
+ if ((*i) == piece)
+ {
+ i = pieces.erase(i);
+ result = true;
+ continue;
+ }
+ ++i;
+ }
+ return result;
+}
+
+/**
+ * Returns the total value of pieces belonging to colour
+ * @param colour the colour
+ * @returns the total value of pieces belonging to colour.
+ * (Redundant repetition <3)
+ */
+int Board::TotalPieceValue(const Piece::Colour & colour) const
+{
+ int result = 0;
+ for (vector<Piece*>::const_iterator i = pieces.begin(); i != pieces.end(); ++i)
+ {
+ if ((*i)->colour == colour || colour == Piece::BOTH)
+ {
+ result += (*i)->PieceValue();
+ }
+ }
+ return result;
+}
+
+/**
+ * Returns the total number of mobile pieces belonging to colour
+ * @param colour the colour
+ * @returns the total value of mobile pieces belonging to colour.
+ * (Redundant repetition <3)
+ */
+int Board::MobilePieces(const Piece::Colour & colour) const
+{
+ int result = 0;
+ for (vector<Piece*>::const_iterator i = pieces.begin(); i != pieces.end(); ++i)
+ {
+ if ((*i)->colour == colour || colour == Piece::BOTH)
+ {
+ if ((*i)->type <= Piece::MARSHAL && (*i)->type >= Piece::SPY)
+ result++;
+ }
+ }
+ return result;
+}