|
| 1 | +/* |
| 2 | + * Wonder.cpp |
| 3 | + * |
| 4 | + * Created on: Apr 10, 2014 |
| 5 | + * Author: Kyle Grage |
| 6 | + */ |
| 7 | + |
| 8 | +#include "Wonder.h" |
| 9 | + |
| 10 | +#include "City.h" |
| 11 | +#include "Settlement.h" |
| 12 | +#include "GameVisitor.h" |
| 13 | + |
| 14 | +/** |
| 15 | + * Construct a city. |
| 16 | + * @param board The GameBoard the city is a part of. |
| 17 | + * @param location The location of the city |
| 18 | + * @param owner The owner of the city |
| 19 | + */ |
| 20 | +Wonder::Wonder(GameBoard& board, Coordinate location, Player& owner) : CornerPiece(board, location, owner) { |
| 21 | + |
| 22 | +} |
| 23 | + |
| 24 | +/** |
| 25 | + * Destroy the city object. |
| 26 | + */ |
| 27 | +Wonder::~Wonder() { |
| 28 | + |
| 29 | +} |
| 30 | + |
| 31 | +/** |
| 32 | + * |
| 33 | + * @param visitor The visiting member. |
| 34 | + */ |
| 35 | +void Wonder::accept(GameVisitor& visitor) { |
| 36 | + visitor.visit(*this); |
| 37 | +} |
| 38 | + |
| 39 | +/** |
| 40 | + * Test for equality with another game piece. |
| 41 | + * @param p The piece to test with |
| 42 | + * @return True if this object is equal to the other, false if not. |
| 43 | + */ |
| 44 | +bool Wonder::operator==(const GamePiece& p) const { |
| 45 | + return false; //TODO: Actually compare. |
| 46 | +} |
| 47 | + |
| 48 | +/** |
| 49 | + * The number of resources this city gets from an adjacent tile when it pays out. |
| 50 | + * @return The number of resources acquired from one adjacent tile. |
| 51 | + */ |
| 52 | +int Wonder::getResourceModifier() { |
| 53 | + return 10; |
| 54 | +} |
| 55 | + |
| 56 | +/** |
| 57 | + * The victory points the city is worth. |
| 58 | + * @return The victory points the player gets from the city. |
| 59 | + */ |
| 60 | +int Wonder::getVictoryPoints() { |
| 61 | + return 10; |
| 62 | +} |
| 63 | + |
| 64 | +/** |
| 65 | + * Construct a Wonder from an existing CornerPiece (e.g. when upgrading a Settlement to a Wonder). |
| 66 | + * @param sett The CornerPiece to take initialization data from. |
| 67 | + */ |
| 68 | +Wonder::Wonder(CornerPiece& sett) : CornerPiece(sett.getBoard(), sett.getLocation(), sett.getOwner()) { |
| 69 | + |
| 70 | +} |
| 71 | + |
0 commit comments