diff options
Diffstat (limited to 'src/game_data.cpp')
| -rw-r--r-- | src/game_data.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
| diff --git a/src/game_data.cpp b/src/game_data.cpp index 4d448d3..828808f 100644 --- a/src/game_data.cpp +++ b/src/game_data.cpp | |||
| @@ -756,6 +756,18 @@ struct GameData { | |||
| 756 | } | 756 | } |
| 757 | } | 757 | } |
| 758 | 758 | ||
| 759 | if (subway_it["entrances"]) { | ||
| 760 | for (const auto &entrance_it : subway_it["entrances"]) { | ||
| 761 | subway_item.entrances.push_back(entrance_it.as<std::string>()); | ||
| 762 | } | ||
| 763 | } | ||
| 764 | |||
| 765 | if (subway_it["exits"]) { | ||
| 766 | for (const auto &exit_it : subway_it["exits"]) { | ||
| 767 | subway_item.exits.push_back(exit_it.as<std::string>()); | ||
| 768 | } | ||
| 769 | } | ||
| 770 | |||
| 759 | if (subway_it["sunwarp"]) { | 771 | if (subway_it["sunwarp"]) { |
| 760 | SubwaySunwarp sunwarp; | 772 | SubwaySunwarp sunwarp; |
| 761 | sunwarp.dots = subway_it["sunwarp"]["dots"].as<int>(); | 773 | sunwarp.dots = subway_it["sunwarp"]["dots"].as<int>(); |
| @@ -879,6 +891,11 @@ GameData &GetState() { | |||
| 879 | 891 | ||
| 880 | } // namespace | 892 | } // namespace |
| 881 | 893 | ||
| 894 | bool SubwayItem::HasWarps() const { | ||
| 895 | return !(this->tags.empty() && this->entrances.empty() && | ||
| 896 | this->exits.empty()); | ||
| 897 | } | ||
| 898 | |||
| 882 | bool SubwaySunwarp::operator<(const SubwaySunwarp &rhs) const { | 899 | bool SubwaySunwarp::operator<(const SubwaySunwarp &rhs) const { |
| 883 | return std::tie(dots, type) < std::tie(rhs.dots, rhs.type); | 900 | return std::tie(dots, type) < std::tie(rhs.dots, rhs.type); |
| 884 | } | 901 | } |
