1 #ifndef LSL_HEADERGUARD_SPRINGUNITSYNC_DATA_H 2 #define LSL_HEADERGUARD_SPRINGUNITSYNC_DATA_H 3 4 #include <vector> 5 #include <map> 6 #include <string> 7 8 namespace LSL { 9 10 struct UnitsyncMod 11 { UnitsyncModUnitsyncMod12 UnitsyncMod() 13 : name(std::string()),hash(std::string()) 14 {} UnitsyncModUnitsyncMod15 UnitsyncMod(const std::string& name, const std::string& hash) 16 : name(name),hash(hash) 17 {} 18 std::string name; 19 std::string hash; 20 }; 21 22 struct StartPos 23 { 24 int x; 25 int y; 26 }; 27 28 struct MapInfo 29 { 30 std::string description; 31 int tidalStrength; 32 int gravity; 33 float maxMetal; 34 int extractorRadius; 35 int minWind; 36 int maxWind; 37 38 int width; 39 int height; 40 std::vector<StartPos> positions; 41 42 std::string author; MapInfoMapInfo43 MapInfo(): 44 description(""), 45 tidalStrength(0), 46 gravity(0), 47 maxMetal(0.0f), 48 extractorRadius(0), 49 minWind(0), 50 maxWind(0), 51 width(0), 52 height(0), 53 author("") 54 { 55 } 56 }; 57 58 struct UnitsyncMap 59 { UnitsyncMapUnitsyncMap60 UnitsyncMap(): 61 name(std::string()), 62 hash(std::string()) 63 {} UnitsyncMapUnitsyncMap64 UnitsyncMap(const std::string& name, const std::string& hash): 65 name(name), 66 hash(hash) 67 {} 68 std::string name; 69 std::string hash; 70 MapInfo info; 71 }; 72 73 enum GameFeature 74 { 75 USYNC_Sett_Handler, 76 USYNC_GetInfoMap, 77 USYNC_GetDataDir, 78 USYNC_GetSkirmishAI 79 }; 80 81 enum MediaType 82 { 83 map, 84 mod 85 }; 86 87 88 typedef std::map<std::string,std::string> LocalArchivesVector; 89 90 } // namespace LSL 91 92 /** 93 * \file data.h 94 * \section LICENSE 95 Copyright 2012 by The libSpringLobby team. All rights reserved. 96 97 Redistribution and use in source and binary forms, with or without modification, are 98 permitted provided that the following conditions are met: 99 100 1. Redistributions of source code must retain the above copyright notice, this list of 101 conditions and the following disclaimer. 102 103 2. Redistributions in binary form must reproduce the above copyright notice, this list 104 of conditions and the following disclaimer in the documentation and/or other materials 105 provided with the distribution. 106 107 THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 108 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 109 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 110 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 111 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 112 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 113 USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 114 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 115 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 116 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 117 **/ 118 119 #endif // SPRINGLOBBY_HEADERGUARD_SPRINGUNITSYNC_DATA_H 120