MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / load

Method load

src/Battlescape/AlienBAIState.cpp:83–98  ·  view source on GitHub ↗

* Loads the AI state from a YAML file. * @param node YAML node. */

Source from the content-addressed store, hash-verified

81 * @param node YAML node.
82 */
83void AlienBAIState::load(const YAML::Node &node)
84{
85 int fromNodeID, toNodeID;
86 fromNodeID = node["fromNode"].as<int>(-1);
87 toNodeID = node["toNode"].as<int>(-1);
88 _AIMode = node["AIMode"].as<int>(0);
89 _wasHit = node["wasHit"].as<bool>(false);
90 if (fromNodeID != -1)
91 {
92 _fromNode = _save->getNodes()->at(fromNodeID);
93 }
94 if (toNodeID != -1)
95 {
96 _toNode = _save->getNodes()->at(toNodeID);
97 }
98}
99
100/**
101 * Saves the AI state to a YAML file.

Callers

nothing calls this directly

Calls 1

getNodesMethod · 0.80

Tested by

no test coverage detected