git repos / saland

commit cb147fbf

Poul Sander · 2019-04-21 13:25
cb147fbf9ed03c0376684038b4c7113fc9d4adab patch · browse files
parent b03c0b7e0df713c2f261ed776d150975783e9acd

Add command to open the shop

Changed files

M src/saland/Game.cpp before
diff --git a/src/saland/Game.cpp b/src/saland/Game.cpp index 490d5ad..83327e5 100644 --- a/src/saland/Game.cpp +++ b/src/saland/Game.cpp
@@ -111,8 +111,21 @@ struct ResetRegionConsoleCommand : public ConsoleCommand {
}
};
+struct ShopCommand : public ConsoleCommand {
+ virtual std::string getCommand() const override {return "shop";}
+ virtual std::string run(const std::vector<std::string>&) override {
+ throw std::runtime_error("Not implemented!");
+ return "Region reset queued!";
+ }
+
+ virtual std::string helpMessage() const override {
+ return "Opens a shop";
+ }
+};
+
static GotoConsoleCommand gcc;
static ResetRegionConsoleCommand rrcc;
+static ShopCommand sc;
static Player player;
@@ -176,6 +189,7 @@ void Game::ResetWorld(int x, int y, bool forceResetWorld) {
Game::Game() {
RegisterCommand(&gcc);
RegisterCommand(&rrcc);
+ RegisterCommand(&sc);
data.reset(new Game::GameImpl());
data->human.reset(new Human());
data->lastUpdate = SDL_GetTicks();