Created
September 28, 2024 01:30
-
-
Save gbowne1/757c91a2f58b8aaeb2b39377d1bc375c to your computer and use it in GitHub Desktop.
ghmiranda-drug-wars-fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <memory> | |
enum class Objects { | |
Acid, | |
Weed, | |
Speed, | |
Cocaine, | |
Ludes, | |
Heroin | |
}; | |
enum class Places { | |
Bronx, | |
Ghetto, | |
Central_Park, | |
Manhattan, | |
Conney_Island, | |
Brooklyn | |
}; | |
std::string getPlaceString(Places place) { | |
switch (place) { | |
case Places::Bronx: return "Bronx"; | |
case Places::Ghetto: return "Ghetto"; | |
case Places::Central_Park: return "Central Park"; | |
case Places::Manhattan: return "Manhattan"; | |
case Places::Conney_Island: return "Conney Island"; | |
case Places::Brooklyn: return "Brooklyn"; | |
} | |
return ""; | |
} | |
class Bags { | |
// Class implementation... | |
}; | |
class Basic_Trenchcoat : public Bags { | |
public: | |
Basic_Trenchcoat() : Bags(100) { } | |
}; | |
class Player { | |
private: | |
int Money; | |
std::unique_ptr<Bags> inventory; | |
public: | |
Player() : Money(5000), inventory(std::make_unique<Basic_Trenchcoat>()) {} | |
// Destructor not needed; unique_ptr automatically cleans up. | |
// Other member functions... | |
}; | |
class Bank { | |
private: | |
int money; | |
double tax; | |
public: | |
Bank(double taxvalue = 0.05) : money(0), tax(taxvalue) {} | |
// Other member functions... | |
}; | |
class Region { | |
private: | |
RegionManager* manager; | |
Places name; | |
public: | |
Region() : manager(nullptr) {} | |
virtual ~Region() {} | |
void setManager(RegionManager* manager_ptr) { | |
manager = manager_ptr; | |
} | |
// Other member functions... | |
}; | |
// Rest of the classes... | |
int main() { | |
Game game; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment