From 43353d5243f2cf5b5c16cc46df2ce2378e7e090e Mon Sep 17 00:00:00 2001 From: Stefan Pranger Date: Thu, 13 Aug 2020 11:38:26 +0200 Subject: [PATCH] store name index map for player member --- src/storm/storage/prism/Player.cpp | 26 +++++++++++++------------- src/storm/storage/prism/Player.h | 10 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/storm/storage/prism/Player.cpp b/src/storm/storage/prism/Player.cpp index 2905a3b29..62c6af36e 100644 --- a/src/storm/storage/prism/Player.cpp +++ b/src/storm/storage/prism/Player.cpp @@ -2,7 +2,7 @@ namespace storm { namespace prism { - Player::Player(std::string const& playerName, std::vector const& controlledModules, std::vector const& controlledCommands, std::string const& filename, uint_fast64_t lineNumber) : LocatedInformation(filename, lineNumber), playerName(playerName), controlledModules(controlledModules), controlledCommands(controlledCommands) { + Player::Player(std::string const& playerName, std::map const& controlledModules, std::map const& controlledCommands, std::string const& filename, uint_fast64_t lineNumber) : LocatedInformation(filename, lineNumber), playerName(playerName), controlledModules(controlledModules), controlledCommands(controlledCommands) { // Nothing to do here. } @@ -10,11 +10,11 @@ namespace storm { return this->playerName; } - std::vector const& Player::getModules() const { + std::map const& Player::getModules() const { return this->controlledModules; } - std::vector const& Player::getCommands() const { + std::map const& Player::getCommands() const { return this->controlledCommands; } @@ -24,16 +24,16 @@ namespace storm { stream << " " << player.getName(); } stream << std::endl; - for (auto const& module : player.getModules()) { - stream << module.getName() << " "; - //&module != (player.getModules()).back ? std::cout << "," : std::cout << std::endl; - } - stream << std::endl; - for (auto const& command : player.getCommands()) { - stream << "[" << command.getActionName() << "] "; - //&command != (player.getCommands()).back ? std::cout << "," : std::cout << std::endl; - } - stream << std::endl; + //for (auto const& module : player.getModules()) { + // stream << module.getName() << " "; + // //&module != (player.getModules()).back ? std::cout << "," : std::cout << std::endl; + //} + //stream << std::endl; + //for (auto const& command : player.getCommands()) { + // stream << "[" << command.getActionName() << "] "; + // //&command != (player.getCommands()).back ? std::cout << "," : std::cout << std::endl; + //} + //stream << std::endl; stream << "endplayer" << std::endl; return stream; } diff --git a/src/storm/storage/prism/Player.h b/src/storm/storage/prism/Player.h index ee4689417..1098cd75f 100644 --- a/src/storm/storage/prism/Player.h +++ b/src/storm/storage/prism/Player.h @@ -24,7 +24,7 @@ namespace storm { * @param filename The filename in which the player is defined. * @param lineNumber The line number in which the player is defined. */ - Player(std::string const& playerName, std::vector const& controlledModules, std::vector const& controlledCommands, std::string const& filename = "", uint_fast64_t lineNumber = 0); + Player(std::string const& playerName, std::map const& controlledModules, std::map const& controlledCommands, std::string const& filename = "", uint_fast64_t lineNumber = 0); // Create default implementations of constructors/assignment. Player() = default; @@ -45,14 +45,14 @@ namespace storm { * * @return The modules controlled by the player. */ - std::vector const& getModules() const; + std::map const& getModules() const; // TODO /*! * Retrieves all controlled Commands of the player. * * @return The commands controlled by the player. */ - std::vector const& getCommands() const; + std::map const& getCommands() const; friend std::ostream& operator<<(std::ostream& stream, Player const& player); private: @@ -60,10 +60,10 @@ namespace storm { std::string playerName; // The modules associated with this player. - std::vector controlledModules; + std::map controlledModules; // The commands associated with this player. - std::vector controlledCommands; + std::map controlledCommands; }; } // namespace prism