1 /* StartConditions.h 2 Copyright (c) 2015 by Michael Zahniser 3 4 Endless Sky is free software: you can redistribute it and/or modify it under the 5 terms of the GNU General Public License as published by the Free Software 6 Foundation, either version 3 of the License, or (at your option) any later version. 7 8 Endless Sky is distributed in the hope that it will be useful, but WITHOUT ANY 9 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 10 PARTICULAR PURPOSE. See the GNU General Public License for more details. 11 */ 12 13 #ifndef START_CONDITIONS_H_ 14 #define START_CONDITIONS_H_ 15 16 #include "CoreStartData.h" 17 18 #include "ConditionSet.h" 19 #include "Conversation.h" 20 21 #include <string> 22 #include <vector> 23 24 class DataNode; 25 class Ship; 26 class Sprite; 27 28 29 30 class StartConditions : public CoreStartData { 31 public: 32 StartConditions() = default; 33 explicit StartConditions(const DataNode &node); 34 35 void Load(const DataNode &node); 36 // Finish loading the ship definitions. 37 void FinishLoading(); 38 39 // A valid start scenario has a valid system, planet, and conversation. 40 // Any ships given to the player must also be valid models. 41 bool IsValid() const; 42 43 const ConditionSet &GetConditions() const noexcept; 44 const std::vector<Ship> &Ships() const noexcept; 45 46 // Get this start's intro conversation. 47 const Conversation &GetConversation() const; 48 49 // Information needed for the scenario picker. 50 const Sprite *GetThumbnail() const noexcept; 51 const std::string &GetDisplayName() const noexcept; 52 const std::string &GetDescription() const noexcept; 53 54 55 private: 56 // Conditions that will be set for any pilot that begins with this scenario. 57 ConditionSet conditions; 58 // Ships that a new pilot begins with (rather than being required to purchase one). 59 std::vector<Ship> ships; 60 61 // The conversation to display when a game begins with this scenario. 62 Conversation conversation; 63 const Conversation *stockConversation = nullptr; 64 65 const Sprite *thumbnail = nullptr; 66 // The user-friendly display name for this starting scenario. 67 std::string name; 68 std::string description; 69 }; 70 71 72 73 #endif 74