1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ 2 3 #ifndef LUA_RULESPARAMS_H 4 #define LUA_RULESPARAMS_H 5 6 #include <string> 7 #include <vector> 8 #include <map> 9 #include "System/creg/creg_cond.h" 10 11 namespace LuaRulesParams 12 { 13 enum { 14 RULESPARAMLOS_PRIVATE = 1, //! only readable by the ally (default) 15 RULESPARAMLOS_ALLIED = 2, //! readable for ally + ingame allied 16 RULESPARAMLOS_INLOS = 4, //! readable if the unit is in LOS 17 RULESPARAMLOS_INRADAR = 8, //! readable if the unit is in AirLOS 18 RULESPARAMLOS_PUBLIC = 16, //! readable for all 19 20 //! note: that the following constants include all states beneath it (e.g. PRIVATE_MASK includes PUBLIC,ALLIED,INLOS,...) 21 RULESPARAMLOS_PRIVATE_MASK = 31, 22 RULESPARAMLOS_ALLIED_MASK = 30, 23 RULESPARAMLOS_INLOS_MASK = 28, 24 RULESPARAMLOS_INRADAR_MASK = 24, 25 RULESPARAMLOS_PUBLIC_MASK = 16 26 }; 27 28 struct Param { 29 CR_DECLARE_STRUCT(Param) 30 ParamParam31 Param() : los(RULESPARAMLOS_PRIVATE),valueInt(0.0f) {}; 32 33 int los; 34 float valueInt; 35 std::string valueString; 36 }; 37 38 typedef std::vector<Param> Params; 39 typedef std::map<std::string, int> HashMap; 40 } 41 42 #endif // LUA_RULESPARAMS_H 43