New lua versions
[ryzomcore.git] / studio / src / plugins / mission_compiler / validation_file.h
blob2675bfba7c9d8daa8b6b3af8d47807e637c40d51
1 #ifndef VALIDATION_FILE_H
2 #define VALIDATION_FILE_H
4 #include <deque>
5 #include <map>
6 #include <string>
8 #include <nel/ligo/primitive.h>
10 struct CMissionState
12 std::string name;
13 std::string state;
14 std::string hashKey;
15 CMissionState(std::string _name, std::string _state, std::string _hashKey)
16 : name(_name), state(_state), hashKey(_hashKey) { }
19 struct CMission
21 std::string name;
22 std::string hashKey;
23 CMission(std::string _name, std::string _hashKey)
24 : name(_name), hashKey(_hashKey) { }
25 bool parsePrim(NLLIGO::IPrimitive const* prim);
28 class CValidationFile
30 public:
31 typedef std::map<std::string, CMissionState> TMissionStateContainer;
32 std::deque<std::string> _AuthorizedStates;
33 TMissionStateContainer _MissionStates;
34 public:
35 // CValidationFile() { }
36 void loadMissionValidationFile(std::string filename);
37 void saveMissionValidationFile(std::string filename);
38 void insertMission(std::string const& mission, std::string const& hashKey)
40 _MissionStates.insert(std::make_pair(mission, CMissionState(mission, defaultState(), hashKey)));
42 std::string defaultState()
44 if (!_AuthorizedStates.empty())
45 return _AuthorizedStates.front();
46 else
47 return "";
51 #endif // VALIDATION_FILE_H