From 0e1e97da9e8937d19b0101dcc1f3a16e3db495b6 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 6 Feb 2021 21:15:34 -0500 Subject: Added sound and animation changes to scripting --- src/game.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/game.h') diff --git a/src/game.h b/src/game.h index 2f1149d..87e23d3 100644 --- a/src/game.h +++ b/src/game.h @@ -43,7 +43,7 @@ public: }); } - int emplaceSprite(); + int emplaceSprite(std::string alias); const Sprite& getSprite(int id) const { return sprites_.at(id); @@ -57,6 +57,10 @@ public: return spriteIds_; } + int getSpriteByAlias(std::string alias) const { + return spritesByAlias_.at(alias); + } + auto spriteView() const { return ranges::views::transform([&] (int id) -> const Sprite& { return sprites_.at(id); @@ -85,6 +89,7 @@ private: std::vector spriteIds_; std::vector sprites_; + std::map spritesByAlias_; std::unique_ptr map_; Font font_; }; -- cgit 1.4.1