22 #include <yaml-cpp/yaml.h> 23 #include <SDL_video.h> 24 #include "RuleTerrain.h" 30 enum MapDirection {MD_NONE, MD_VERTICAL, MD_HORIZONTAL, MD_BOTH};
34 std::map<std::string, MCDReplacement> replacements;
38 if (replacements.find(type) == replacements.end())
43 return &replacements[type];
46 enum MapScriptCommand {MSC_UNDEFINED = -1, MSC_ADDBLOCK, MSC_ADDLINE, MSC_ADDCRAFT, MSC_ADDUFO, MSC_DIGTUNNEL, MSC_FILLAREA, MSC_CHECKBLOCK, MSC_REMOVE, MSC_RESIZE};
54 MapScriptCommand _type;
55 std::vector<SDL_Rect*> _rects;
56 std::vector<int> _groups, _blocks, _frequencies, _maxUses, _conditionals;
57 std::vector<int> _groupsTemp, _blocksTemp, _frequenciesTemp, _maxUsesTemp;
58 int _sizeX, _sizeY, _sizeZ, _executionChances, _executions, _cumulativeFrequency, _label;
59 MapDirection _direction;
71 void load(
const YAML::Node& node);
75 MapScriptCommand
getType()
const {
return _type;};
77 const std::vector<SDL_Rect*> *
getRects()
const {
return &_rects;};
93 const std::vector<int> *
getGroups()
const {
return &_groups;};
95 const std::vector<int> *
getBlocks()
const {
return &_blocks;};
103 std::string getUFOName()
const;
int getExecutions() const
Gets how many times this command repeats (1 repeat means 2 executions)
Definition: MapScript.h:89
Represents a Terrain Map Block.
Definition: MapBlock.h:37
const std::vector< SDL_Rect * > * getRects() const
Gets the rects, describing the areas this command applies to.
Definition: MapScript.h:77
MapScriptCommand getType() const
Gets what type of command this is.
Definition: MapScript.h:75
int getSizeX() const
Gets the X size for this command.
Definition: MapScript.h:79
TunnelData * getTunnelData()
Gets the mcd replacement data for tunnel replacements.
Definition: MapScript.h:99
const std::vector< int > * getBlocks() const
Gets the blocks vector for iteration.
Definition: MapScript.h:95
int getSizeY() const
Gets the Y size for this command.
Definition: MapScript.h:81
int getSizeZ() const
Gets the Z size for this command.
Definition: MapScript.h:83
const std::vector< int > * getGroups() const
Gets the groups vector for iteration.
Definition: MapScript.h:93
const std::vector< int > * getConditionals() const
Gets what conditions apply to this command.
Definition: MapScript.h:91
Definition: MapScript.h:31
MapDirection getDirection() const
Gets the direction this command goes (for lines and tunnels).
Definition: MapScript.h:97
Definition: MapScript.h:32
int getLabel() const
Gets the label for this command.
Definition: MapScript.h:87
Definition: MapScript.h:51
int getChancesOfExecution() const
Get the chances of this command executing.
Definition: MapScript.h:85
Represents a specific type of Battlescape Terrain.
Definition: RuleTerrain.h:39
Definition: BaseInfoState.cpp:40