23 #include <yaml-cpp/yaml.h> 24 #include "../Savegame/WeightedOptions.h" 28 enum GenerationType { GEN_REGION, GEN_MISSION, GEN_RACE };
29 class WeightedOptions;
33 std::string _type, _varName;
34 int _firstMonth, _lastMonth, _label, _executionOdds, _targetBaseOdds, _minDifficulty, _maxRuns, _avoidRepeats, _delay;
35 std::vector<int> _conditionals;
36 std::vector<std::pair<size_t, WeightedOptions*> > _regionWeights, _missionWeights, _raceWeights;
37 std::map<std::string, bool> _researchTriggers;
38 bool _useTable, _siteType;
45 void load(
const YAML::Node& node);
53 std::vector<std::string>
getRegions(
const int month)
const;
91 std::string
generate(
const size_t monthsPassed,
const GenerationType type)
const;
const std::vector< int > & getConditionals() const
Gets the list of conditions this command requires in order to run.
Definition: RuleMissionScript.cpp:191
const std::map< std::string, bool > & getResearchTriggers() const
Gets the research triggers that may apply to this command.
Definition: RuleMissionScript.cpp:223
~RuleMissionScript()
Deletes a mission script.
Definition: RuleMissionScript.cpp:38
bool hasRegionWeights() const
Does this command have region weights?
Definition: RuleMissionScript.cpp:215
void load(const YAML::Node &node)
Loads a mission script from yaml.
Definition: RuleMissionScript.cpp:58
std::string generate(const size_t monthsPassed, const GenerationType type) const
Generates either a region, a mission, or a race based on the month.
Definition: RuleMissionScript.cpp:317
std::vector< std::string > getRegions(const int month) const
Gets a list of the regions in this command's region weights for a given month.
Definition: RuleMissionScript.cpp:290
std::vector< std::string > getMissionTypes(const int month) const
Gets a list of the mission types in this command's mission weights for a given month.
Definition: RuleMissionScript.cpp:265
int getExecutionOdds() const
Gets the odds of this command executing.
Definition: RuleMissionScript.cpp:143
void setSiteType(const bool siteType)
Sets this script to a terror mission type command or not.
Definition: RuleMissionScript.cpp:334
bool hasMissionWeights() const
Does this command have mission weights?
Definition: RuleMissionScript.cpp:207
bool getSiteType() const
Checks if this is a terror-type mission or not.
Definition: RuleMissionScript.cpp:342
std::string getVarName() const
Gets the name of the variable to use for keeping track of... things.
Definition: RuleMissionScript.cpp:239
bool getUseTable() const
Delete this mission from the table? stops it coming up again in random selection, but NOT if a missio...
Definition: RuleMissionScript.cpp:231
int getFirstMonth() const
Gets the first month this command will run.
Definition: RuleMissionScript.cpp:119
int getLastMonth() const
Gets the last month this command will run.
Definition: RuleMissionScript.cpp:127
int getMinDifficulty() const
Gets the minimum difficulty for this command to run.
Definition: RuleMissionScript.cpp:159
int getLabel() const
Gets the label of this command, used for conditionals.
Definition: RuleMissionScript.cpp:135
int getTargetBaseOdds() const
Gets the odds of this mission targetting an xcom base.
Definition: RuleMissionScript.cpp:151
Definition: RuleMissionScript.h:30
std::string getType() const
Gets the name of the script command.
Definition: RuleMissionScript.cpp:111
int getDelay() const
Gets the number of minutes to delay spawning of the first wave of this mission, overrides the spawn d...
Definition: RuleMissionScript.cpp:183
std::set< std::string > getAllMissionTypes() const
Gets a complete and unique list of all the mission types contained within this command.
Definition: RuleMissionScript.cpp:247
int getRepeatAvoidance() const
Gets how many previous mission sites to keep track of (to avoid using them again) ...
Definition: RuleMissionScript.cpp:175
RuleMissionScript(const std::string &type)
Creates a new mission script.
Definition: RuleMissionScript.cpp:29
int getMaxRuns() const
Gets the maximum number of times to run a command with this varName.
Definition: RuleMissionScript.cpp:167
Definition: BaseInfoState.cpp:40
bool hasRaceWeights() const
Does this command have raceWeights?
Definition: RuleMissionScript.cpp:199