#include #include #include "WarehouseT.h" using namespace std; WarehouseT::WarehouseT(){ } void WarehouseT::Wood(int i){ if (i + wood < 0) { throw out_of_range("Can not have negative wood."); } wood += i; } int WarehouseT::Wood(void) const{ return wood; } void WarehouseT::Food(int i){ if (i + food < 0) { throw out_of_range("Can not have negative food."); } food += i; } int WarehouseT::Food(void) const{ return food; } void WarehouseT::Gold(int i){ if (i + gold < 0) { throw out_of_range("Can not have negative gold."); } gold += i; } int WarehouseT::Gold(void) const{ return gold; } void WarehouseT::Construction(int i){ if (i + construction < 0) { throw out_of_range("Can not have negative construction."); } construction += i; } int WarehouseT::Construction(void) const{ return construction; } void WarehouseT::Coins(int i){ if (i + coins < 0) { throw out_of_range("Can not have negative coins."); } coins += i; } int WarehouseT::Coins(void) const{ return coins; } void WarehouseT::Victory(int i){ if (i + victory < 0) { throw out_of_range("Can not have negative victory."); } victory += i; } int WarehouseT::Victory(void) const{ return victory; }