\r
-Microsoft Visual Studio Solution File, Format Version 10.00\r
-# Visual C++ Express 2008\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgameservgldl", "libgameservgldl\libgameservgldl.vcproj", "{3CED9BD5-BEAA-4C36-A735-AFF2B3F2CF42}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {279AA91C-8638-45E5-AAA3-988F74764A97} = {279AA91C-8638-45E5-AAA3-988F74764A97}\r
- EndProjectSection\r
+Microsoft Visual Studio Solution File, Format Version 11.00\r
+# Visual Studio 2010\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgameservgldl", "libgameservgldl\libgameservgldl.vcxproj", "{3CED9BD5-BEAA-4C36-A735-AFF2B3F2CF42}"\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgameservcore", "libgameservcore\libgameservcore.vcproj", "{279AA91C-8638-45E5-AAA3-988F74764A97}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgameservcore", "libgameservcore\libgameservcore.vcxproj", "{279AA91C-8638-45E5-AAA3-988F74764A97}"\r
EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdriver", "testdriver\testdriver.vcproj", "{9DAAD910-02AF-431F-88F2-08434ECB5102}"\r
- ProjectSection(ProjectDependencies) = postProject\r
- {279AA91C-8638-45E5-AAA3-988F74764A97} = {279AA91C-8638-45E5-AAA3-988F74764A97}\r
- {3CED9BD5-BEAA-4C36-A735-AFF2B3F2CF42} = {3CED9BD5-BEAA-4C36-A735-AFF2B3F2CF42}\r
- EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testdriver", "testdriver\testdriver.vcxproj", "{9DAAD910-02AF-431F-88F2-08434ECB5102}"\r
EndProject\r
Global\r
GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
#ifndef __GS__TYPES_H__\r
#define __GS__TYPES_H__\r
\r
+#include <ctime>\r
#include <string>\r
using std::string;\r
#include <GameServ/GameServException.h>\r
using GameServ::Exceptions::GameServException;\r
\r
-#include <ctime>\r
-#include <boost/random/linear_congruential.hpp>\r
-#include <boost/random/uniform_int.hpp>\r
-#include <boost/random/uniform_real.hpp>\r
-#include <boost/random/variate_generator.hpp>\r
-// Sun CC doesn't handle boost::iterator_adaptor yet\r
-#if !defined(__SUNPRO_CC) || (__SUNPRO_CC > 0x530)\r
-#include <boost/generator_iterator.hpp>\r
-#endif\r
-\r
-#ifdef BOOST_NO_STDC_NAMESPACE\r
-namespace std {\r
- using ::time;\r
-}\r
-#endif\r
-\r
-// This is a typedef for a random number generator.\r
-// Try boost::mt19937 or boost::ecuyer1988 instead of boost::minstd_rand\r
-typedef boost::minstd_rand base_generator_type;\r
-\r
-\r
namespace GameServ \r
{ \r
namespace Types\r
static const modifierinfo mModifierInfoTable[];\r
}; // Modifiers class\r
\r
- template <class T>\r
- class Range\r
+ class IntRange\r
{\r
public:\r
\r
- Range()\r
- {\r
- }\r
+ IntRange();\r
\r
- Range(const T &high, const T &low)\r
- {\r
- mHigh = high;\r
- mLow = low;\r
- mLastRandom = T(0);\r
- }\r
+ IntRange(const int &high, const int &low);\r
\r
- ~Range()\r
- {\r
- }\r
+ ~IntRange();\r
\r
- //! Generate a random number within the range\r
- T Random()\r
- {\r
- static base_generator_type generator(static_cast<T>(std::time(0)));\r
- if (mLow == mHigh)\r
- {\r
- return mLow;\r
- }\r
- else\r
- {\r
- boost::uniform_int<> uni_dist(mLow, mHigh);\r
- boost::variate_generator<base_generator_type&, boost::uniform_int<> > uni(generator, uni_dist);\r
- mLastRandom = uni();\r
- return mLastRandom;\r
- }\r
- }\r
+ //! Generate a random number within the IntRange\r
+ int Random();\r
\r
//! Property get - High\r
- T High(void) const\r
- {\r
- return mHigh;\r
- }\r
+ int High(void) const;\r
\r
//! Property set - High\r
- void High(const T &value)\r
- {\r
- if (value >= mLow)\r
- {\r
- mHigh = value;\r
- }\r
- }\r
+ void High(const int &value);\r
\r
//! Property get - Low\r
- T Low(void) const\r
- {\r
- return mLow;\r
- }\r
+ int Low(void) const;\r
+ \r
\r
//! Property set - Low\r
- void Low(const T &value)\r
- {\r
- if (value <= mHigh)\r
- {\r
- mLow = value;\r
- }\r
- }\r
+ void Low(const int &value);\r
\r
//! Property get - Last random number to be generated\r
- T LastRandom(void) const\r
- {\r
- return mLastRandom;\r
- }\r
+ int LastRandom(void) const;\r
+ \r
+ \r
+ private:\r
+ int mHigh;\r
+ int mLow;\r
+ int mLastRandom;\r
+ };\r
+\r
+ class UIntRange\r
+ {\r
+ public:\r
+\r
+ UIntRange();\r
+\r
+ UIntRange(const unsigned int &high, const unsigned int &low);\r
+\r
+ ~UIntRange();\r
+\r
+ //! Generate a random number within the IntRange\r
+ unsigned int Random();\r
+\r
+ //! Property get - High\r
+ unsigned int High(void) const;\r
+\r
+ //! Property set - High\r
+ void High(const unsigned int &value);\r
+\r
+ //! Property get - Low\r
+ unsigned int Low(void) const;\r
+\r
+ //! Property set - Low\r
+ void Low(const unsigned int &value);\r
+\r
+ //! Property get - Last random number to be generated\r
+ unsigned int LastRandom(void) const;\r
\r
private:\r
- T mHigh;\r
- T mLow;\r
- T mLastRandom;\r
+ unsigned int mHigh;\r
+ unsigned int mLow;\r
+ unsigned int mLastRandom;\r
};\r
} \r
}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{279AA91C-8638-45E5-AAA3-988F74764A97}</ProjectGuid>\r
+ <RootNamespace>libgameservcore</RootNamespace>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>StaticLibrary</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup>\r
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Users\ddatti\Documents\Visual Studio 2010\Projects\C++\boost_1_47_0;$(IncludePath)</IncludePath>\r
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Users\ddatti\Documents\Visual Studio 2010\Projects\C++\boost_1_47_0\stage\lib;$(LibraryPath)</LibraryPath>\r
+ </PropertyGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>$(ProjectDir)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;TIXML_USE_STL;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+ </ClCompile>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="src\GameServException.cpp" />\r
+ <ClCompile Include="src\Types.cpp" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="include\GameServ\GameServException.h" />\r
+ <ClInclude Include="include\GameServ\Types.h" />\r
+ </ItemGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file
#include <GameServ/Types.h>\r
using GameServ::Types::ItemTypes;\r
using GameServ::Types::Modifiers;\r
-using GameServ::Types::Range;\r
+using GameServ::Types::IntRange;\r
+using GameServ::Types::UIntRange;\r
using GameServ::Types::ObjectTypes;\r
using GameServ::Types::Exceptions::TypeException;\r
\r
#include <string>\r
using std::string;\r
-\r
-\r
using std::exception;\r
\r
#include <boost/format.hpp>\r
using boost::format;\r
using boost::str;\r
\r
+#include <boost/random/mersenne_twister.hpp>\r
+#include <boost/random/uniform_int_distribution.hpp>\r
+\r
+#ifdef BOOST_NO_STDC_NAMESPACE\r
+namespace std {\r
+ using ::time;\r
+}\r
+#endif\r
+\r
+// This is a typedef for a random number generator.\r
+// Try boost::mt19937 or boost::ecuyer1988 instead of boost::minstd_rand\r
+typedef boost::random::mt19937 base_generator_type;\r
+\r
+\r
+\r
\r
TypeException::TypeException(const string &ErrorMsg, const char *pFilename, int SourceLine)\r
: GameServException(ErrorMsg, pFilename, SourceLine)\r
\r
throw TypeException(str(format("No modifier enumeration found for %1%") % modifier), __FILE__, __LINE__);\r
}\r
+\r
+IntRange::IntRange() \r
+{\r
+}\r
+\r
+IntRange::~IntRange()\r
+{\r
+}\r
+\r
+IntRange::IntRange(const int &high, const int &low)\r
+{\r
+ mHigh = high;\r
+ mLow = low;\r
+ mLastRandom = 0;\r
+}\r
+\r
+int IntRange::Random() \r
+{\r
+ static base_generator_type generator(static_cast<int>(std::time(0)));\r
+ if (mLow == mHigh)\r
+ {\r
+ return mLow;\r
+ }\r
+ else\r
+ {\r
+ boost::random::uniform_int_distribution<> dist(mLow, mHigh);\r
+ mLastRandom = dist(generator);\r
+ return mLastRandom;\r
+ }\r
+}\r
+\r
+int IntRange::High(void) const\r
+{\r
+ return mHigh;\r
+}\r
+\r
+void IntRange::High(const int &value)\r
+{\r
+ if (value >= mLow)\r
+ {\r
+ mHigh = value;\r
+ }\r
+}\r
+\r
+int IntRange::Low(void) const\r
+{\r
+ return mLow;\r
+}\r
+\r
+void IntRange::Low(const int &value)\r
+{\r
+ if (value <= mHigh)\r
+ {\r
+ mLow = value;\r
+ }\r
+}\r
+\r
+int IntRange::LastRandom(void) const\r
+{\r
+ return mLastRandom;\r
+}\r
+\r
+/**/\r
+\r
+UIntRange::UIntRange() \r
+{\r
+}\r
+\r
+UIntRange::~UIntRange()\r
+{\r
+}\r
+\r
+UIntRange::UIntRange(const unsigned int &high, const unsigned int &low)\r
+{\r
+ mHigh = high;\r
+ mLow = low;\r
+ mLastRandom = 0;\r
+}\r
+\r
+unsigned int UIntRange::Random() \r
+{\r
+ static base_generator_type generator(static_cast<unsigned int>(std::time(0)));\r
+ if (mLow == mHigh)\r
+ {\r
+ return mLow;\r
+ }\r
+ else\r
+ {\r
+ boost::random::uniform_int_distribution<> dist(mLow, mHigh);\r
+ mLastRandom = dist(generator);\r
+ return mLastRandom;\r
+ }\r
+}\r
+\r
+unsigned int UIntRange::High(void) const\r
+{\r
+ return mHigh;\r
+}\r
+\r
+void UIntRange::High(const unsigned int &value)\r
+{\r
+ if (value >= mLow)\r
+ {\r
+ mHigh = value;\r
+ }\r
+}\r
+\r
+unsigned int UIntRange::Low(void) const\r
+{\r
+ return mLow;\r
+}\r
+\r
+void UIntRange::Low(const unsigned int &value)\r
+{\r
+ if (value <= mHigh)\r
+ {\r
+ mLow = value;\r
+ }\r
+}\r
+\r
+unsigned int UIntRange::LastRandom(void) const\r
+{\r
+ return mLastRandom;\r
+}\r
using GameServ::DataLayer::IDAOFactory;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
namespace GameServ { namespace DataLayer\r
{\r
data access objects. Ids and resources in one DataAccessObject of one provider can mean completely\r
different things in another provider.\r
*/\r
- static shared_ptr<IDAOFactory> GetDataAccessFactory(const string &Provider);\r
+ static boost::shared_ptr<IDAOFactory> GetDataAccessFactory(const string &Provider);\r
\r
\r
};\r
\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
namespace GameServ { namespace DataLayer { namespace File\r
{\r
\r
// Overrides //////////////////////////////////////////////////////////\r
\r
- virtual shared_ptr<IPlayerDAO> GetPlayerDAO(void) const;\r
- virtual shared_ptr<IItemDAO> GetItemDAO(void) const;\r
- virtual shared_ptr<IMonsterDAO> GetMonsterDAO(void) const;\r
- virtual shared_ptr<IMasterDAO> GetMasterDAO(void) const;\r
- virtual shared_ptr<ILevelDAO> GetLevelDAO(void) const;\r
+ virtual boost::shared_ptr<IPlayerDAO> GetPlayerDAO(void) const;\r
+ virtual boost::shared_ptr<IItemDAO> GetItemDAO(void) const;\r
+ virtual boost::shared_ptr<IMonsterDAO> GetMonsterDAO(void) const;\r
+ virtual boost::shared_ptr<IMasterDAO> GetMasterDAO(void) const;\r
+ virtual boost::shared_ptr<ILevelDAO> GetLevelDAO(void) const;\r
\r
private:\r
\r
#include <GameServ/DataLayer/IItemDAO.h>\r
using GameServ::DataLayer::DataAccessObjects::IItemDAO;\r
\r
-#include <boost/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~FileItemDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<ItemGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<ItemGO> GetById(const string &Id) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
\r
void LoadItemCache(void);\r
\r
- void Insert(shared_ptr<ItemGO> spItem);\r
- void Update(shared_ptr<ItemGO> spItem);\r
+ void Insert(boost::shared_ptr<ItemGO> spItem);\r
+ void Update(boost::shared_ptr<ItemGO> spItem);\r
\r
private:\r
//! Data file\r
// Helper Methods /////////////////////////////////////////////////////\r
\r
//! Creates the ItemGO found at iterator position\r
- shared_ptr<ItemGO> CreateItemFromLine(const string &line) const;\r
- shared_ptr<ItemGO> CreatePotionFromLine(const string &line) const;\r
+ boost::shared_ptr<ItemGO> CreateItemFromLine(const string &line) const;\r
+ boost::shared_ptr<ItemGO> CreatePotionFromLine(const string &line) const;\r
\r
//! Get the Item database file path\r
string GetItemFilePath(void) const;\r
void Initialize(const string &filename);\r
\r
\r
- map<string, shared_ptr<ItemGO> > spItemCache;\r
+ map<string, boost::shared_ptr<ItemGO> > spItemCache;\r
};\r
} } } // GameServ.DataLayer.DataAccessObjects.File\r
\r
using GameServ::DataLayer::DataAccessObjects::ILevelDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~FileLevelDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<LevelGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<LevelGO> GetById(const string &Id) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
\r
- virtual void Insert(shared_ptr<LevelGO> spLevel);\r
- virtual void Update(shared_ptr<LevelGO> spLevel);\r
+ virtual void Insert(boost::shared_ptr<LevelGO> spLevel);\r
+ virtual void Update(boost::shared_ptr<LevelGO> spLevel);\r
\r
void LoadLevelCache(void);\r
\r
// Helper Methods /////////////////////////////////////////////////////\r
\r
//! Creates the LevelGO found at iterator position\r
- shared_ptr<LevelGO> CreateLevelFromLine(const string &line) const;\r
+ boost::shared_ptr<LevelGO> CreateLevelFromLine(const string &line) const;\r
\r
//! Get the Level database file path\r
string GetLevelFilePath(void) const;\r
\r
void Initialize(const string &filename);\r
\r
- map<string, shared_ptr<LevelGO> > spLevelCache;\r
+ map<string, boost::shared_ptr<LevelGO> > spLevelCache;\r
};\r
} } } // GameServ.DataLayer.DataAccessObjects.File\r
\r
using GameServ::DataLayer::DataAccessObjects::IMasterDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~FileMasterDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<MasterGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<MasterGO> GetById(const string &Id) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
- void Update(shared_ptr<MasterGO> spMaster);\r
- void Insert(shared_ptr<MasterGO> spMaster);\r
+ void Update(boost::shared_ptr<MasterGO> spMaster);\r
+ void Insert(boost::shared_ptr<MasterGO> spMaster);\r
\r
void LoadMasterCache(void);\r
\r
// Helper Methods /////////////////////////////////////////////////////\r
\r
//! Creates the MasterGO found at iterator position\r
- shared_ptr<MasterGO> CreateMasterFromLine(const string &line) const;\r
+ boost::shared_ptr<MasterGO> CreateMasterFromLine(const string &line) const;\r
\r
//! Get the Master database file path\r
string GetMasterFilePath(void) const;\r
\r
void Initialize(const string &filename);\r
\r
- map<string, shared_ptr<MasterGO> > spMasterCache;\r
+ map<string, boost::shared_ptr<MasterGO> > spMasterCache;\r
};\r
} } } // GameServ.DataLayer.DataAccessObjects.File\r
\r
using GameServ::DataLayer::DataAccessObjects::IMonsterDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~FileMonsterDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<MonsterGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<MonsterGO> GetById(const string &Id) const;\r
\r
virtual vector<string> GetMonsterIdsByLevelId(const string &LevelId) const;\r
\r
void LoadMonsterCache(void);\r
\r
\r
- void Update(shared_ptr<MonsterGO> spMonster);\r
- void Insert(shared_ptr<MonsterGO> spMonster);\r
+ void Update(boost::shared_ptr<MonsterGO> spMonster);\r
+ void Insert(boost::shared_ptr<MonsterGO> spMonster);\r
\r
private:\r
//! Data file\r
// Helper Methods /////////////////////////////////////////////////////\r
\r
//! Creates the MonsterGO found at iterator position\r
- shared_ptr<MonsterGO> CreateMonsterFromLine(const string &line) const;\r
+ boost::shared_ptr<MonsterGO> CreateMonsterFromLine(const string &line) const;\r
\r
//! Get the Monster database file path\r
string GetMonsterFilePath(void) const;\r
\r
void Initialize(const string &filename);\r
\r
- map<string, shared_ptr<MonsterGO> > spMonsterCache;\r
+ map<string, boost::shared_ptr<MonsterGO> > spMonsterCache;\r
};\r
} } } // GameServ.DataLayer.DataAccessObjects.File\r
\r
using GameServ::DataLayer::DataAccessObjects::IPlayerDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~FilePlayerDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<PlayerGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<PlayerGO> GetById(const string &Id) const;\r
\r
virtual list<string> GetIdsByName(const string &Name) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
\r
- virtual void Insert(shared_ptr<PlayerGO> spPlayer);\r
- virtual void Update(shared_ptr<PlayerGO> spPlayer);\r
+ virtual void Insert(boost::shared_ptr<PlayerGO> spPlayer);\r
+ virtual void Update(boost::shared_ptr<PlayerGO> spPlayer);\r
\r
- virtual void SetFlags(shared_ptr<PlayerGO> spPlayer, const int &flags) const;\r
- virtual int GetFlags(shared_ptr<PlayerGO> spPlayer) const;\r
+ virtual void SetFlags(boost::shared_ptr<PlayerGO> spPlayer, const int &flags) const;\r
+ virtual int GetFlags(boost::shared_ptr<PlayerGO> spPlayer) const;\r
\r
void LoadPlayerCache(void);\r
void WritePlayerCache(void) const;\r
// Helper Methods /////////////////////////////////////////////////////\r
\r
//! Creates the PlayerGO found at iterator position\r
- shared_ptr<PlayerGO> CreatePlayerFromLine(const string &line) const;\r
- void LoadInventoryFromLine(shared_ptr<PlayerGO> spPlayer, const string &line) const;\r
- string CreateLineFromPlayer(shared_ptr<PlayerGO> spPlayer) const;\r
+ boost::shared_ptr<PlayerGO> CreatePlayerFromLine(const string &line) const;\r
+ void LoadInventoryFromLine(boost::shared_ptr<PlayerGO> spPlayer, const string &line) const;\r
+ string CreateLineFromPlayer(boost::shared_ptr<PlayerGO> spPlayer) const;\r
\r
//! Get the Player database file path\r
string GetPlayerFilePath(void) const;\r
\r
void Initialize(const string &filename);\r
\r
- map<string, shared_ptr<PlayerGO> > spPlayerCache;\r
+ map<string, boost::shared_ptr<PlayerGO> > spPlayerCache;\r
};\r
} } } // GameServ.DataLayer.DataAccessObjects.File\r
\r
\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
namespace GameServ { namespace DataLayer \r
{\r
virtual ~IDAOFactory(void) { }\r
\r
//! Player DataAccessObject for all Player related operations\r
- virtual shared_ptr<IPlayerDAO> GetPlayerDAO(void) const = 0;\r
+ virtual boost::shared_ptr<IPlayerDAO> GetPlayerDAO(void) const = 0;\r
\r
//! Item DataAccessObject for all item related operations\r
- virtual shared_ptr<IItemDAO> GetItemDAO(void) const = 0;\r
+ virtual boost::shared_ptr<IItemDAO> GetItemDAO(void) const = 0;\r
\r
//! Monster DataAccessObject for all monster related operations\r
- virtual shared_ptr<IMonsterDAO> GetMonsterDAO(void) const = 0;\r
+ virtual boost::shared_ptr<IMonsterDAO> GetMonsterDAO(void) const = 0;\r
\r
//! Master DataAccessObject for all master related operations\r
- virtual shared_ptr<IMasterDAO> GetMasterDAO(void) const = 0;\r
+ virtual boost::shared_ptr<IMasterDAO> GetMasterDAO(void) const = 0;\r
\r
//! Level DataAccessObject for all level related operations\r
- virtual shared_ptr<ILevelDAO> GetLevelDAO(void) const = 0;\r
+ virtual boost::shared_ptr<ILevelDAO> GetLevelDAO(void) const = 0;\r
\r
\r
\r
#include <GameServ/GameLayer/GameObjects/ItemGO.h>\r
using GameServ::GameLayer::GameObjects::ItemGO;\r
\r
-#include <boost/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
+\r
\r
#include <list>\r
using std::list;\r
\return A boost shared pointer to a Item game object if found\r
otherwise the list is empty.\r
*/\r
- virtual shared_ptr<ItemGO> GetById(const string &Id) const = 0;\r
+ virtual boost::shared_ptr<ItemGO> GetById(const string &Id) const = 0;\r
\r
//! Function to quickly search to see if an Id exists or not\r
/*!\r
*/\r
virtual bool IdExists(const string &Id) const = 0;\r
\r
- virtual void Insert(shared_ptr<ItemGO> spItem) = 0;\r
- virtual void Update(shared_ptr<ItemGO> spItem) = 0;\r
+ virtual void Insert(boost::shared_ptr<ItemGO> spItem) = 0;\r
+ virtual void Update(boost::shared_ptr<ItemGO> spItem) = 0;\r
\r
private:\r
\r
using GameServ::GameLayer::GameObjects::LevelGO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <list>\r
using std::list;\r
\return A boost shared pointer to a Level game object if found\r
otherwise the list is empty.\r
*/\r
- virtual shared_ptr<LevelGO> GetById(const string &Id) const = 0;\r
+ virtual boost::shared_ptr<LevelGO> GetById(const string &Id) const = 0;\r
\r
//! Function to quickly search to see if an Id exists or not\r
/*!\r
*/\r
virtual bool IdExists(const string &Id) const = 0;\r
\r
- virtual void Insert(shared_ptr<LevelGO> spLevel) = 0;\r
- virtual void Update(shared_ptr<LevelGO> spLevel) = 0;\r
+ virtual void Insert(boost::shared_ptr<LevelGO> spLevel) = 0;\r
+ virtual void Update(boost::shared_ptr<LevelGO> spLevel) = 0;\r
\r
private:\r
\r
using GameServ::GameLayer::GameObjects::MasterGO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <list>\r
using std::list;\r
\return A boost shared pointer to a Master game object if found\r
otherwise the list is empty.\r
*/\r
- virtual shared_ptr<MasterGO> GetById(const string &Id) const = 0;\r
+ virtual boost::shared_ptr<MasterGO> GetById(const string &Id) const = 0;\r
\r
//! Function to quickly search to see if an Id exists or not\r
/*!\r
*/\r
virtual bool IdExists(const string &Id) const = 0;\r
\r
- virtual void Update(shared_ptr<MasterGO> spMaster) = 0;\r
- virtual void Insert(shared_ptr<MasterGO> spMaster) = 0;\r
+ virtual void Update(boost::shared_ptr<MasterGO> spMaster) = 0;\r
+ virtual void Insert(boost::shared_ptr<MasterGO> spMaster) = 0;\r
\r
private:\r
\r
using GameServ::GameLayer::GameObjects::MonsterGO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <vector>\r
using std::vector;\r
\return A boost shared pointer to a Monster game object if found\r
otherwise the list is empty.\r
*/\r
- virtual shared_ptr<MonsterGO> GetById(const string &Id) const = 0;\r
+ virtual boost::shared_ptr<MonsterGO> GetById(const string &Id) const = 0;\r
\r
//! Function to quickly search to see if an Id exists or not\r
/*!\r
\r
virtual vector<string> GetMonsterIdsByLevelId(const string &LevelId) const = 0;\r
\r
- virtual void Update(shared_ptr<MonsterGO> spMonster) = 0;\r
- virtual void Insert(shared_ptr<MonsterGO> spMonster) = 0;\r
+ virtual void Update(boost::shared_ptr<MonsterGO> spMonster) = 0;\r
+ virtual void Insert(boost::shared_ptr<MonsterGO> spMonster) = 0;\r
\r
private:\r
\r
using GameServ::GameLayer::GameObjects::PlayerGO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <list>\r
using std::list;\r
\return A boost shared pointer to a Player game object if found\r
otherwise the list is empty.\r
*/\r
- virtual shared_ptr<PlayerGO> GetById(const string &Id) const = 0;\r
+ virtual boost::shared_ptr<PlayerGO> GetById(const string &Id) const = 0;\r
\r
/*! Get a list of Player Ids by Name\r
\param Name The partial name of the Player to match against the beginning of a Player name\r
*/\r
virtual bool IdExists(const string &Id) const = 0;\r
\r
- virtual void Insert(shared_ptr<PlayerGO> spPlayer) = 0;\r
- virtual void Update(shared_ptr<PlayerGO> spPlayer) = 0;\r
+ virtual void Insert(boost::shared_ptr<PlayerGO> spPlayer) = 0;\r
+ virtual void Update(boost::shared_ptr<PlayerGO> spPlayer) = 0;\r
private:\r
\r
\r
\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
namespace GameServ { namespace DataLayer { namespace MySQL\r
{\r
\r
// Overrides //////////////////////////////////////////////////////////\r
\r
- virtual shared_ptr<IPlayerDAO> GetPlayerDAO(void) const;\r
- virtual shared_ptr<IItemDAO> GetItemDAO(void) const;\r
- virtual shared_ptr<IMonsterDAO> GetMonsterDAO(void) const;\r
- virtual shared_ptr<IMasterDAO> GetMasterDAO(void) const;\r
- virtual shared_ptr<ILevelDAO> GetLevelDAO(void) const;\r
+ virtual boost::shared_ptr<IPlayerDAO> GetPlayerDAO(void) const;\r
+ virtual boost::shared_ptr<IItemDAO> GetItemDAO(void) const;\r
+ virtual boost::shared_ptr<IMonsterDAO> GetMonsterDAO(void) const;\r
+ virtual boost::shared_ptr<IMasterDAO> GetMasterDAO(void) const;\r
+ virtual boost::shared_ptr<ILevelDAO> GetLevelDAO(void) const;\r
\r
private:\r
\r
#include <GameServ/DataLayer/IItemDAO.h>\r
using GameServ::DataLayer::DataAccessObjects::IItemDAO;\r
\r
-#include <boost/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~MySQLItemDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<ItemGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<ItemGO> GetById(const string &Id) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
\r
- virtual void Insert(shared_ptr<ItemGO> spItem);\r
- virtual void Update(shared_ptr<ItemGO> spItem);\r
+ virtual void Insert(boost::shared_ptr<ItemGO> spItem);\r
+ virtual void Update(boost::shared_ptr<ItemGO> spItem);\r
\r
private:\r
//! Data mysql\r
using GameServ::DataLayer::DataAccessObjects::ILevelDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~MySQLLevelDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<LevelGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<LevelGO> GetById(const string &Id) const;\r
\r
virtual list<string> GetIdsByName(const string &Name) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
\r
- virtual void Insert(shared_ptr<LevelGO> spLevel);\r
- virtual void Update(shared_ptr<LevelGO> spLevel);\r
+ virtual void Insert(boost::shared_ptr<LevelGO> spLevel);\r
+ virtual void Update(boost::shared_ptr<LevelGO> spLevel);\r
\r
\r
private:\r
#include <GameServ/DataLayer/IMasterDAO.h>\r
using GameServ::DataLayer::DataAccessObjects::IMasterDAO;\r
\r
-#include <boost/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~MySQLMasterDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<MasterGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<MasterGO> GetById(const string &Id) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
\r
- virtual void Insert(shared_ptr<MasterGO> spMaster);\r
- virtual void Update(shared_ptr<MasterGO> spMaster);\r
+ virtual void Insert(boost::shared_ptr<MasterGO> spMaster);\r
+ virtual void Update(boost::shared_ptr<MasterGO> spMaster);\r
\r
private:\r
//! Data mysql\r
#include <GameServ/DataLayer/IMonsterDAO.h>\r
using GameServ::DataLayer::DataAccessObjects::IMonsterDAO;\r
\r
-#include <boost/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~MySQLMonsterDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<MonsterGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<MonsterGO> GetById(const string &Id) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
\r
- virtual void Insert(shared_ptr<MonsterGO> spMonster);\r
- virtual void Update(shared_ptr<MonsterGO> spMonster);\r
+ virtual void Insert(boost::shared_ptr<MonsterGO> spMonster);\r
+ virtual void Update(boost::shared_ptr<MonsterGO> spMonster);\r
\r
private:\r
//! Data mysql\r
using GameServ::DataLayer::DataAccessObjects::IPlayerDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
virtual ~MySQLPlayerDAO();\r
\r
// Methods ////////////////////////////////////////////////////////////\r
- virtual shared_ptr<PlayerGO> GetById(const string &Id) const;\r
+ virtual boost::shared_ptr<PlayerGO> GetById(const string &Id) const;\r
\r
virtual list<string> GetIdsByName(const string &Name) const;\r
\r
virtual bool IdExists(const string &Id) const;\r
\r
- virtual void Insert(shared_ptr<PlayerGO> spPlayer);\r
- virtual void Update(shared_ptr<PlayerGO> spPlayer);\r
+ virtual void Insert(boost::shared_ptr<PlayerGO> spPlayer);\r
+ virtual void Update(boost::shared_ptr<PlayerGO> spPlayer);\r
\r
\r
private:\r
\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
\r
#include <string>\r
using std::string;\r
FightGL();\r
~FightGL();\r
\r
- unsigned int PlayerAttackMonster(shared_ptr<PlayerGO> spPlayer, shared_ptr<MonsterGO> spMonster);\r
- unsigned int MonsterAttackPlayer(shared_ptr<MonsterGO> spMonster, shared_ptr<PlayerGO> spPlayer);\r
+ unsigned int PlayerAttackMonster(boost::shared_ptr<PlayerGO> spPlayer, boost::shared_ptr<MonsterGO> spMonster);\r
+ unsigned int MonsterAttackPlayer(boost::shared_ptr<MonsterGO> spMonster, boost::shared_ptr<PlayerGO> spPlayer);\r
\r
- unsigned int PlayerAttackPlayer(shared_ptr<PlayerGO> spPlayerAttacker, shared_ptr<PlayerGO> spPlayerDefender);\r
+ unsigned int PlayerAttackPlayer(boost::shared_ptr<PlayerGO> spPlayerAttacker, boost::shared_ptr<PlayerGO> spPlayerDefender);\r
\r
\r
private:\r
\r
unsigned int CalculateAttack(unsigned int strength, unsigned int defense);\r
void Initialize();\r
- shared_ptr<IPlayerDAO> mspPlayerDAO;\r
+ boost::shared_ptr<IPlayerDAO> mspPlayerDAO;\r
};\r
\r
}}\r
\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
ForestGL();\r
~ForestGL();\r
\r
- shared_ptr<MonsterGO> GetRandomMonsterForPlayer(shared_ptr<PlayerGO> spPlayer);\r
+ boost::shared_ptr<MonsterGO> GetRandomMonsterForPlayer(boost::shared_ptr<PlayerGO> spPlayer);\r
\r
private:\r
void Initialize();\r
- shared_ptr<IMonsterDAO> mspMonsterDAO;\r
- shared_ptr<ILevelDAO> mspLevelDAO;\r
+ boost::shared_ptr<IMonsterDAO> mspMonsterDAO;\r
+ boost::shared_ptr<ILevelDAO> mspLevelDAO;\r
};\r
\r
}}\r
using std::unary_function;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
namespace GameServ { namespace GameLayer { namespace GameObjects\r
{\r
};\r
\r
//! Functor to compare Id's of Game Objects\r
- class GameObjectIds_Eq : public unary_function<shared_ptr<GameObject>, bool>\r
+ class GameObjectIds_Eq : public unary_function<boost::shared_ptr<GameObject>, bool>\r
{\r
public:\r
explicit GameObjectIds_Eq(const string &Id);\r
\r
- //! Comparison against shared_ptr types\r
- bool operator()(const shared_ptr<GameObject> &BO) const;\r
+ //! Comparison against boost::shared_ptr types\r
+ bool operator()(const boost::shared_ptr<GameObject> &BO) const;\r
\r
private:\r
string mId;\r
#include <GameServ/Types.h>\r
using GameServ::Types::ItemTypes;\r
using GameServ::Types::Modifiers;\r
-using GameServ::Types::Range;\r
+using GameServ::Types::IntRange;\r
using GameServ::Types::ObjectTypes;\r
\r
#include <string>\r
virtual ItemTypes::ItemType Type(void) const = 0;\r
\r
//! Property get - Modifiers\r
- map<Modifiers::Modifier, Range<int> > Modifiers(void) const;\r
+ map<Modifiers::Modifier, IntRange> Modifiers(void) const;\r
\r
//! Property set - Modifiers\r
- void Modifiers(const map<Modifiers::Modifier, Range<int> > &modifiers);\r
+ void Modifiers(const map<Modifiers::Modifier, IntRange> &modifiers);\r
\r
//! Use item on a game object\r
- virtual void Use(shared_ptr<GameObject> spObject);\r
+ virtual void Use(boost::shared_ptr<GameObject> spObject);\r
//! Undo item's last effect on a game object\r
- virtual void Undo(shared_ptr<GameObject> spObject);\r
+ virtual void Undo(boost::shared_ptr<GameObject> spObject);\r
\r
virtual ItemGO *Clone(void) const = 0;\r
\r
string mName;\r
unsigned long int mPrice;\r
int mUses;\r
- map<Modifiers::Modifier, Range<int> > mModifiers;\r
+ map<Modifiers::Modifier, IntRange> mModifiers;\r
\r
//! Base class standard modifier applier. Simply adds the modified stat to the correct stat\r
- virtual void ApplyModifier(shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, Range<int> r);\r
- virtual void UndoModifier(shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, Range<int> r);\r
+ virtual void ApplyModifier(boost::shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, IntRange);\r
+ virtual void UndoModifier(boost::shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, IntRange);\r
};\r
}}}\r
#endif
\ No newline at end of file
\r
#include <GameServ/Types.h>\r
using GameServ::Types::ObjectTypes;\r
-using GameServ::Types::Range;\r
+using GameServ::Types::IntRange;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
using std::vector;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
namespace GameServ { namespace GameLayer { namespace GameObjects\r
{\r
unsigned int Number(void) const;\r
\r
//! Property set - Strength Range\r
- void StrengthRange(const Range<int> &value);\r
+ void StrengthRange(const IntRange &value);\r
//! Property get - Strength Range\r
- Range<int> StrengthRange(void) const;\r
+ IntRange StrengthRange(void) const;\r
\r
\r
//! Property set - Defense Range\r
- void DefenseRange(const Range<int> &value);\r
+ void DefenseRange(const IntRange &value);\r
//! Property get - Defense Range\r
- Range<int> DefenseRange(void) const;\r
+ IntRange DefenseRange(void) const;\r
\r
//! Property set - Gold Range\r
- void GoldRange(const Range<int> &value);\r
+ void GoldRange(const IntRange &value);\r
//! Property get - Gold Range\r
- Range<int> GoldRange(void) const;\r
+ IntRange GoldRange(void) const;\r
\r
//! Property set - Experience Range\r
- void ExperienceRange(const Range<int> &value);\r
+ void ExperienceRange(const IntRange &value);\r
//! Property get - Experience Range\r
- Range<int> ExperienceRange(void) const;\r
+ IntRange ExperienceRange(void) const;\r
\r
\r
//! Property set - Health Range\r
- void HealthRange(const Range<int> &value);\r
+ void HealthRange(const IntRange &value);\r
//! Property get - Health Range\r
- Range<int> HealthRange(void) const;\r
+ IntRange HealthRange(void) const;\r
\r
\r
private:\r
unsigned int mNumber;\r
- Range<int> mStrength;\r
- Range<int> mDefense;\r
- Range<int> mGold;\r
- Range<int> mExperience;\r
- Range<int> mHealth;\r
+ IntRange mStrength;\r
+ IntRange mDefense;\r
+ IntRange mGold;\r
+ IntRange mExperience;\r
+ IntRange mHealth;\r
};\r
}}} // GameServ::GameLayer::GameObjects\r
#endif
\ No newline at end of file
using GameServ::Types::ObjectTypes;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
\r
#include <string>\r
using std::string;\r
void WeaponId(const string &value);\r
\r
//! Property get - Weapon\r
- shared_ptr<WeaponGO> Weapon(void) const;\r
+ boost::shared_ptr<WeaponGO> Weapon(void) const;\r
//! Property set - Weapon\r
- void Weapon(shared_ptr<WeaponGO> spWeapon);\r
+ void Weapon(boost::shared_ptr<WeaponGO> spWeapon);\r
\r
//! Property get - ArmorId\r
string ArmorId(void) const;\r
void ArmorId(const string &value);\r
\r
//! Property get - Armor\r
- shared_ptr<ArmorGO> Armor(void) const;\r
+ boost::shared_ptr<ArmorGO> Armor(void) const;\r
//! Property set - Armor\r
- void Armor(shared_ptr<ArmorGO> spArmor);\r
+ void Armor(boost::shared_ptr<ArmorGO> spArmor);\r
\r
//! Property set - Password\r
void Password(const string &value);\r
int mForestFights;\r
int mPlayerFights;\r
string mPassword;\r
- shared_ptr<WeaponGO> mWeapon;\r
- shared_ptr<ArmorGO> mArmor;\r
+ boost::shared_ptr<WeaponGO> mWeapon;\r
+ boost::shared_ptr<ArmorGO> mArmor;\r
ptime mLastLogin;\r
\r
bool mFoughtMaster;\r
#define __GS__INVENTORYMANAGER_H__\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
#include <GameServ/GameLayer/GameObjects/ItemGO.h>\r
using GameServ::GameLayer::GameObjects::ItemGO;\r
\r
namespace GameServ { namespace GameLayer { namespace Helpers {\r
\r
\r
-typedef list< shared_ptr<ItemGO> > ItemList;\r
+typedef list< boost::shared_ptr<ItemGO> > ItemList;\r
typedef map<string, ItemList> PlayerInventoryMap;\r
\r
\r
public:\r
~InventoryManager();\r
\r
- static shared_ptr<InventoryManager> Instance();\r
+ static boost::shared_ptr<InventoryManager> Instance();\r
\r
- void AddItem(const string &PlayerId, shared_ptr<ItemGO> spItem);\r
- void RemoveItem(const string &PlayerId, shared_ptr<ItemGO> spItem);\r
+ void AddItem(const string &PlayerId, boost::shared_ptr<ItemGO> spItem);\r
+ void RemoveItem(const string &PlayerId, boost::shared_ptr<ItemGO> spItem);\r
ItemList GetInventory(const string &PlayerId) const; \r
bool PlayerHasInventory(const string &PlayerId) const;\r
\r
private:\r
\r
PlayerInventoryMap mInventoryTable;\r
- static shared_ptr<InventoryManager> mInstance;\r
+ static boost::shared_ptr<InventoryManager> mInstance;\r
\r
}; // InventoryManager\r
\r
using GameServ::DataLayer::DataAccessObjects::IPlayerDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <list>\r
using std::list;\r
PlayerGL();\r
~PlayerGL();\r
\r
- shared_ptr<PlayerGO> GetById(const string &Id);\r
- void Insert(shared_ptr<PlayerGO> spPlayer);\r
+ boost::shared_ptr<PlayerGO> GetById(const string &Id);\r
+ void Insert(boost::shared_ptr<PlayerGO> spPlayer);\r
\r
private:\r
void Initialize();\r
- shared_ptr<IPlayerDAO> mspPlayerDAO;\r
+ boost::shared_ptr<IPlayerDAO> mspPlayerDAO;\r
};\r
\r
}}\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{3CED9BD5-BEAA-4C36-A735-AFF2B3F2CF42}</ProjectGuid>\r
+ <RootNamespace>libgameservgldl</RootNamespace>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>StaticLibrary</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup>\r
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Users\ddatti\Documents\Visual Studio 2010\Projects\C++\mysql-5.5.15-win32\include;C:\MySQL++\include;C:\Users\ddatti\Documents\Visual Studio 2010\Projects\C++\boost_1_47_0;$(IncludePath)</IncludePath>\r
+ <ExecutablePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\Users\ddatti\Documents\Visual Studio 2010\Projects\C++\mysql-5.5.15-win32\bin;$(ExecutablePath)</ExecutablePath>\r
+ <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">C:\MySQL++\lib;C:\Users\ddatti\Documents\Visual Studio 2010\Projects\C++\boost_1_47_0\stage\lib;C:\Users\ddatti\Documents\Visual Studio 2010\Projects\C++\mysql-5.5.15-win32\lib;$(LibraryPath)</LibraryPath>\r
+ </PropertyGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>C:\Users\ddatti\Documents\Visual Studio 2010\Projects\C++\boost_1_47_0;$(ProjectDir)\include;$(ProjectDir)\..\libgameservcore\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS ;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+ </ClCompile>\r
+ <Lib>\r
+ <AdditionalDependencies>libmysql.lib;wsock32.lib;mysqlpp_d.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+ </Lib>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="src\DataLayer\DataAccess.cpp" />\r
+ <ClCompile Include="src\DataLayer\DataLayerExceptions.cpp" />\r
+ <ClCompile Include="src\DataLayer\IItemDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\ILevelDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\IMasterDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\IMonsterDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\IPlayerDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\File\FileDAOFactory.cpp" />\r
+ <ClCompile Include="src\DataLayer\File\FileId.cpp" />\r
+ <ClCompile Include="src\DataLayer\File\FileItemDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\File\FileLevelDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\File\FileMasterDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\File\FileMonsterDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\File\FilePlayerDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLDAOFactory.cpp" />\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLId.cpp" />\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLItemDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLLevelDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLMasterDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLMonsterDAO.cpp" />\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLPlayerDAO.cpp" />\r
+ <ClCompile Include="src\GameLayer\FightGL.cpp" />\r
+ <ClCompile Include="src\GameLayer\ForestGL.cpp" />\r
+ <ClCompile Include="src\GameLayer\PlayerGL.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\ArmorGO.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\GameObject.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\ItemGO.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\LevelGO.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\MasterGO.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\MonsterGO.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\PlayerGO.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\PotionGO.cpp" />\r
+ <ClCompile Include="src\GameLayer\GameObjects\WeaponGO.cpp" />\r
+ <ClCompile Include="src\GameLayer\Helpers\InventoryManager.cpp" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="include\GameServ\DataLayer\DataAccess.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\DataLayerExceptions.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\IDAOFactory.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\IItemDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\ILevelDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\IMasterDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\IMonsterDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\IPlayerDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileDAOFactory.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileId.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileItemDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileLevelDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileMasterDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileMonsterDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FilePlayerDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLDAOFactory.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLId.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLItemDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLLevelDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLMasterDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLMonsterDAO.h" />\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLPlayerDAO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\FightGL.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\ForestGL.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\PlayerGL.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\ArmorGO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\GameObject.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\ItemGO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\LevelGO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\MasterGO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\MonsterGO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\PlayerGO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\PotionGO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\WeaponGO.h" />\r
+ <ClInclude Include="include\GameServ\GameLayer\Helpers\InventoryManager.h" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ProjectReference Include="..\libgameservcore\libgameservcore.vcxproj">\r
+ <Project>{279aa91c-8638-45e5-aaa3-988f74764a97}</Project>\r
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+ </ProjectReference>\r
+ </ItemGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup>\r
+ <Filter Include="DataLayer">\r
+ <UniqueIdentifier>{1c8d1f5d-1ae1-422f-bef8-d9babd1320fa}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="DataLayer\File">\r
+ <UniqueIdentifier>{1c02f37c-8a70-4e8c-ba00-63edf14077df}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="DataLayer\MySQL">\r
+ <UniqueIdentifier>{d2187353-d23f-42f0-bf1b-6beb30fe274d}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="GameLayer">\r
+ <UniqueIdentifier>{0850b3f0-ba53-44ec-9c18-15260f6a3dec}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="GameLayer\GameObjects">\r
+ <UniqueIdentifier>{608549e1-0c0b-4c2f-8a5c-8e62fbd7023b}</UniqueIdentifier>\r
+ </Filter>\r
+ <Filter Include="GameLayer\Helpers">\r
+ <UniqueIdentifier>{d84587f2-8fba-4348-9b78-93434077b256}</UniqueIdentifier>\r
+ </Filter>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="src\DataLayer\DataAccess.cpp">\r
+ <Filter>DataLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\DataLayerExceptions.cpp">\r
+ <Filter>DataLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\IItemDAO.cpp">\r
+ <Filter>DataLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\ILevelDAO.cpp">\r
+ <Filter>DataLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\IMasterDAO.cpp">\r
+ <Filter>DataLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\IMonsterDAO.cpp">\r
+ <Filter>DataLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\IPlayerDAO.cpp">\r
+ <Filter>DataLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\File\FileDAOFactory.cpp">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\File\FileId.cpp">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\File\FileItemDAO.cpp">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\File\FileLevelDAO.cpp">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\File\FileMasterDAO.cpp">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\File\FileMonsterDAO.cpp">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\File\FilePlayerDAO.cpp">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLDAOFactory.cpp">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLId.cpp">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLItemDAO.cpp">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLLevelDAO.cpp">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLMasterDAO.cpp">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLMonsterDAO.cpp">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\DataLayer\MySQL\MySQLPlayerDAO.cpp">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\FightGL.cpp">\r
+ <Filter>GameLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\ForestGL.cpp">\r
+ <Filter>GameLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\PlayerGL.cpp">\r
+ <Filter>GameLayer</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\ArmorGO.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\GameObject.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\ItemGO.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\LevelGO.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\MasterGO.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\MonsterGO.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\PlayerGO.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\PotionGO.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\GameObjects\WeaponGO.cpp">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClCompile>\r
+ <ClCompile Include="src\GameLayer\Helpers\InventoryManager.cpp">\r
+ <Filter>GameLayer\Helpers</Filter>\r
+ </ClCompile>\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ClInclude Include="include\GameServ\DataLayer\DataAccess.h">\r
+ <Filter>DataLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\DataLayerExceptions.h">\r
+ <Filter>DataLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\IDAOFactory.h">\r
+ <Filter>DataLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\IItemDAO.h">\r
+ <Filter>DataLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\ILevelDAO.h">\r
+ <Filter>DataLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\IMasterDAO.h">\r
+ <Filter>DataLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\IMonsterDAO.h">\r
+ <Filter>DataLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\IPlayerDAO.h">\r
+ <Filter>DataLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileDAOFactory.h">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileId.h">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileItemDAO.h">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileLevelDAO.h">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileMasterDAO.h">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FileMonsterDAO.h">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\File\FilePlayerDAO.h">\r
+ <Filter>DataLayer\File</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLDAOFactory.h">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLId.h">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLItemDAO.h">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLLevelDAO.h">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLMasterDAO.h">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLMonsterDAO.h">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\DataLayer\MySQL\MySQLPlayerDAO.h">\r
+ <Filter>DataLayer\MySQL</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\FightGL.h">\r
+ <Filter>GameLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\ForestGL.h">\r
+ <Filter>GameLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\PlayerGL.h">\r
+ <Filter>GameLayer</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\ArmorGO.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\GameObject.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\ItemGO.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\LevelGO.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\MasterGO.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\MonsterGO.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\PlayerGO.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\PotionGO.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\GameObjects\WeaponGO.h">\r
+ <Filter>GameLayer\GameObjects</Filter>\r
+ </ClInclude>\r
+ <ClInclude Include="include\GameServ\GameLayer\Helpers\InventoryManager.h">\r
+ <Filter>GameLayer\Helpers</Filter>\r
+ </ClInclude>\r
+ </ItemGroup>\r
+</Project>
\ No newline at end of file
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
#include <boost/format.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::format;\r
using boost::str;\r
\r
-shared_ptr<IDAOFactory> DataAccess::GetDataAccessFactory(const string &Provider)\r
+boost::shared_ptr<IDAOFactory> DataAccess::GetDataAccessFactory(const string &Provider)\r
{\r
// Make sure a provider was even specified\r
if (Provider.empty())\r
throw DataLayerException("When using the DataLayer you must specify a Provider programatically", __FILE__, __LINE__);\r
\r
if (Provider == "File")\r
- return shared_ptr<IDAOFactory>(new FileDAOFactory());\r
+ return boost::shared_ptr<IDAOFactory>(new FileDAOFactory());\r
// else if (Provider == "MySQL")\r
// PUT OTHER PROVIDERS HERE\r
else\r
using GameServ::DataLayer::File::FileLevelDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
FileDAOFactory::FileDAOFactory(void)\r
{\r
{\r
}\r
\r
-shared_ptr<IPlayerDAO> FileDAOFactory::GetPlayerDAO(void) const\r
+boost::shared_ptr<IPlayerDAO> FileDAOFactory::GetPlayerDAO(void) const\r
{\r
- return shared_ptr<IPlayerDAO>(new FilePlayerDAO());\r
+ return boost::shared_ptr<IPlayerDAO>(new FilePlayerDAO());\r
}\r
\r
-shared_ptr<IItemDAO> FileDAOFactory::GetItemDAO(void) const\r
+boost::shared_ptr<IItemDAO> FileDAOFactory::GetItemDAO(void) const\r
{\r
- return shared_ptr<IItemDAO>(new FileItemDAO());\r
+ return boost::shared_ptr<IItemDAO>(new FileItemDAO());\r
}\r
\r
-shared_ptr<IMonsterDAO> FileDAOFactory::GetMonsterDAO(void) const\r
+boost::shared_ptr<IMonsterDAO> FileDAOFactory::GetMonsterDAO(void) const\r
{\r
- return shared_ptr<IMonsterDAO>(new FileMonsterDAO());\r
+ return boost::shared_ptr<IMonsterDAO>(new FileMonsterDAO());\r
}\r
\r
-shared_ptr<IMasterDAO> FileDAOFactory::GetMasterDAO(void) const\r
+boost::shared_ptr<IMasterDAO> FileDAOFactory::GetMasterDAO(void) const\r
{\r
- return shared_ptr<IMasterDAO>(new FileMasterDAO());\r
+ return boost::shared_ptr<IMasterDAO>(new FileMasterDAO());\r
}\r
\r
-shared_ptr<ILevelDAO> FileDAOFactory::GetLevelDAO(void) const\r
+boost::shared_ptr<ILevelDAO> FileDAOFactory::GetLevelDAO(void) const\r
{\r
- return shared_ptr<ILevelDAO>(new FileLevelDAO());\r
+ return boost::shared_ptr<ILevelDAO>(new FileLevelDAO());\r
}\r
\r
using GameServ::Types::Modifiers;\r
using GameServ::Types::Exceptions::TypeException;\r
\r
-#include <boost/shared_ptr.hpp>\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::format;\r
using boost::str;\r
using boost::algorithm::to_upper;\r
return mFilename;\r
}\r
\r
-shared_ptr<ItemGO> FileItemDAO::GetById(const string &Id) const\r
+boost::shared_ptr<ItemGO> FileItemDAO::GetById(const string &Id) const\r
{\r
- map<string, shared_ptr<ItemGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<ItemGO> >::const_iterator iter;\r
iter = spItemCache.find(Id);\r
if (iter != spItemCache.end())\r
{\r
- return shared_ptr<ItemGO>(iter->second->Clone());\r
+ return boost::shared_ptr<ItemGO>(iter->second->Clone());\r
}\r
else\r
{\r
- return shared_ptr<ItemGO>();\r
+ return boost::shared_ptr<ItemGO>();\r
}\r
}\r
-shared_ptr<ItemGO> FileItemDAO::CreatePotionFromLine(const string &line) const\r
+boost::shared_ptr<ItemGO> FileItemDAO::CreatePotionFromLine(const string &line) const\r
{\r
assert(!line.empty());\r
- shared_ptr<PotionGO> spPotion = shared_ptr<PotionGO>(new PotionGO());\r
- map<Modifiers::Modifier, Range<int> > modifiers;\r
+ boost::shared_ptr<PotionGO> spPotion = boost::shared_ptr<PotionGO>(new PotionGO());\r
+ map<Modifiers::Modifier, IntRange> modifiers;\r
boost::char_separator<char> sep("~", 0, boost::keep_empty_tokens);\r
tokenizer tokens(line, sep);\r
tokenizer::iterator tok_iter = tokens.begin();\r
mFilename % line), __FILE__, __LINE__);\r
}\r
int high = lexical_cast<int>((*tok_iter));\r
- modifiers[Modifiers::strength] = Range<int>(high, low);\r
+ modifiers[Modifiers::strength] = IntRange(high, low);\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
{\r
mFilename % line), __FILE__, __LINE__);\r
}\r
high = lexical_cast<int>((*tok_iter));\r
- modifiers[Modifiers::defense] = Range<int>(high, low);\r
+ modifiers[Modifiers::defense] = IntRange(high, low);\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
mFilename % line), __FILE__, __LINE__);\r
}\r
high = lexical_cast<int>((*tok_iter));\r
- modifiers[Modifiers::maxhealth] = Range<int>(high, low);\r
+ modifiers[Modifiers::maxhealth] = IntRange(high, low);\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
mFilename % line), __FILE__, __LINE__);\r
}\r
high = lexical_cast<int>((*tok_iter));\r
- modifiers[Modifiers::health] = Range<int>(high, low);\r
+ modifiers[Modifiers::health] = IntRange(high, low);\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
mFilename % line), __FILE__, __LINE__);\r
}\r
high = lexical_cast<int>((*tok_iter));\r
- modifiers[Modifiers::forestfights] = Range<int>(high, low);\r
+ modifiers[Modifiers::forestfights] = IntRange(high, low);\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
mFilename % line), __FILE__, __LINE__);\r
}\r
high = lexical_cast<int>((*tok_iter));\r
- modifiers[Modifiers::playerfights] = Range<int>(high, low);\r
+ modifiers[Modifiers::playerfights] = IntRange(high, low);\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
mFilename % line), __FILE__, __LINE__);\r
}\r
high = lexical_cast<int>((*tok_iter));\r
- modifiers[Modifiers::gold] = Range<int>(high, low);\r
+ modifiers[Modifiers::gold] = IntRange(high, low);\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
mFilename % line), __FILE__, __LINE__);\r
}\r
high = lexical_cast<int>((*tok_iter));\r
- modifiers[Modifiers::bank] = Range<int>(high, low);\r
+ modifiers[Modifiers::bank] = IntRange(high, low);\r
\r
return spPotion;\r
}\r
\r
-shared_ptr<ItemGO> FileItemDAO::CreateItemFromLine(const string &line) const\r
+boost::shared_ptr<ItemGO> FileItemDAO::CreateItemFromLine(const string &line) const\r
{\r
assert(!line.empty());\r
- shared_ptr<ItemGO> spItem;\r
- map<Modifiers::Modifier, Range<int> > modifiers;\r
+ boost::shared_ptr<ItemGO> spItem;\r
+ map<Modifiers::Modifier, IntRange> modifiers;\r
boost::char_separator<char> sep("~", 0, boost::keep_empty_tokens);\r
tokenizer tokens(line, sep);\r
tokenizer::iterator tok_iter = tokens.begin();\r
}\r
catch (TypeException)\r
{\r
- return shared_ptr<ItemGO>();\r
+ return boost::shared_ptr<ItemGO>();\r
}\r
\r
switch(type)\r
{\r
case ItemTypes::Weapon:\r
- spItem = shared_ptr<WeaponGO>(new WeaponGO());\r
+ spItem = boost::shared_ptr<WeaponGO>(new WeaponGO());\r
break;\r
case ItemTypes::Armor:\r
- spItem = shared_ptr<ArmorGO>(new ArmorGO());\r
+ spItem = boost::shared_ptr<ArmorGO>(new ArmorGO());\r
break;\r
case ItemTypes::Potion:\r
return CreatePotionFromLine(line);\r
}\r
if ((*tok_iter) != "0")\r
{\r
- modifiers[Modifiers::strength] = Range<int>(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
+ modifiers[Modifiers::strength] = IntRange(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
}\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
}\r
if ((*tok_iter) != "0")\r
{\r
- modifiers[Modifiers::defense] = Range<int>(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
+ modifiers[Modifiers::defense] = IntRange(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
}\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
}\r
if ((*tok_iter) != "0")\r
{\r
- modifiers[Modifiers::maxhealth] = Range<int>(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
+ modifiers[Modifiers::maxhealth] = IntRange(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
}\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
}\r
if ((*tok_iter) != "0")\r
{\r
- modifiers[Modifiers::health] = Range<int>(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
+ modifiers[Modifiers::health] = IntRange(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
}\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
}\r
if ((*tok_iter) != "0")\r
{\r
- modifiers[Modifiers::forestfights] = Range<int>(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
+ modifiers[Modifiers::forestfights] = IntRange(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
}\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
}\r
if ((*tok_iter) != "0")\r
{\r
- modifiers[Modifiers::playerfights] = Range<int>(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
+ modifiers[Modifiers::playerfights] = IntRange(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
}\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
}\r
if ((*tok_iter) != "0")\r
{\r
- modifiers[Modifiers::gold] = Range<int>(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
+ modifiers[Modifiers::gold] = IntRange(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
}\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
}\r
if ((*tok_iter) != "0")\r
{\r
- modifiers[Modifiers::bank] = Range<int>(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
+ modifiers[Modifiers::bank] = IntRange(lexical_cast<int>((*tok_iter)), lexical_cast<int>((*tok_iter)));\r
}\r
spItem->Modifiers(modifiers);\r
\r
}\r
bool FileItemDAO::IdExists(const string &Id) const\r
{\r
- map<string, shared_ptr<ItemGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<ItemGO> >::const_iterator iter;\r
iter = spItemCache.find(Id);\r
return (iter != spItemCache.end());\r
}\r
{\r
continue;\r
}\r
- shared_ptr<ItemGO> spItem = CreateItemFromLine(line);\r
+ boost::shared_ptr<ItemGO> spItem = CreateItemFromLine(line);\r
if (spItem != 0)\r
{\r
spItemCache[spItem->Id()] = spItem;\r
infile.close();\r
}\r
\r
-void FileItemDAO::Insert(shared_ptr<ItemGO> spItem)\r
+void FileItemDAO::Insert(boost::shared_ptr<ItemGO> spItem)\r
{\r
throw DataLayerException("Not implemented", __FILE__, __LINE__);\r
}\r
-void FileItemDAO::Update(shared_ptr<ItemGO> spItem)\r
+void FileItemDAO::Update(boost::shared_ptr<ItemGO> spItem)\r
{\r
throw DataLayerException("Not implemented", __FILE__, __LINE__);\r
}\r
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::shared_static_cast;\r
using boost::format;\r
using boost::str;\r
while (!infile.eof())\r
{\r
string line;\r
- shared_ptr<LevelGO> spLevel;\r
+ boost::shared_ptr<LevelGO> spLevel;\r
getline(infile, line);\r
if (line.empty())\r
{\r
return mFilename;\r
}\r
\r
-shared_ptr<LevelGO> FileLevelDAO::GetById(const string &Id) const\r
+boost::shared_ptr<LevelGO> FileLevelDAO::GetById(const string &Id) const\r
{\r
- map<string, shared_ptr<LevelGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<LevelGO> >::const_iterator iter;\r
iter = spLevelCache.find(Id);\r
if (iter != spLevelCache.end())\r
{\r
- return shared_ptr<LevelGO>(iter->second);\r
+ return boost::shared_ptr<LevelGO>(iter->second);\r
}\r
- return shared_ptr<LevelGO>();\r
+ return boost::shared_ptr<LevelGO>();\r
}\r
\r
-void FileLevelDAO::Insert(shared_ptr<LevelGO> spLevel)\r
+void FileLevelDAO::Insert(boost::shared_ptr<LevelGO> spLevel)\r
{\r
throw DataLayerException("Not implemented", __FILE__, __LINE__);\r
}\r
-void FileLevelDAO::Update(shared_ptr<LevelGO> spLevel)\r
+void FileLevelDAO::Update(boost::shared_ptr<LevelGO> spLevel)\r
{\r
throw DataLayerException("Not implemented", __FILE__, __LINE__);\r
}\r
\r
-shared_ptr<LevelGO> FileLevelDAO::CreateLevelFromLine(const string &line) const\r
+boost::shared_ptr<LevelGO> FileLevelDAO::CreateLevelFromLine(const string &line) const\r
{\r
assert(!line.empty());\r
- shared_ptr<LevelGO> spLevel;\r
- spLevel = shared_ptr<LevelGO>(new LevelGO());\r
+ boost::shared_ptr<LevelGO> spLevel;\r
+ spLevel = boost::shared_ptr<LevelGO>(new LevelGO());\r
boost::char_separator<char> sep("~ ", 0);\r
tokenizer tokens(line, sep);\r
tokenizer::iterator tok_iter = tokens.begin();\r
line % (*tok_iter)));\r
}\r
\r
- spLevel->StrengthRange(Range<int>(high, low));\r
+ spLevel->StrengthRange(IntRange(high, low));\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
throw DataLayerException(str(format("Corrupt level line %1%. Invalid integer value %2%") % \r
line % (*tok_iter)));\r
}\r
- spLevel->DefenseRange(Range<int>(high, low));\r
+ spLevel->DefenseRange(IntRange(high, low));\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
throw DataLayerException(str(format("Corrupt level line %1%. Invalid integer value %2%") % \r
line % (*tok_iter)));\r
}\r
- spLevel->GoldRange(Range<int>(high, low));\r
+ spLevel->GoldRange(IntRange(high, low));\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
throw DataLayerException(str(format("Corrupt level line %1%. Invalid integer value %2%") % \r
line % (*tok_iter)));\r
}\r
- spLevel->ExperienceRange(Range<int>(high, low));\r
+ spLevel->ExperienceRange(IntRange(high, low));\r
\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
throw DataLayerException(str(format("Corrupt level line %1%. Invalid integer value %2%") % \r
line % (*tok_iter)));\r
}\r
- spLevel->HealthRange(Range<int>(high, low));\r
+ spLevel->HealthRange(IntRange(high, low));\r
\r
return spLevel;\r
}\r
\r
bool FileLevelDAO::IdExists(const string &Id) const\r
{\r
- map<string, shared_ptr<LevelGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<LevelGO> >::const_iterator iter;\r
iter = spLevelCache.find(Id);\r
return (iter != spLevelCache.end());\r
}
\ No newline at end of file
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::shared_static_cast;\r
using boost::format;\r
using boost::str;\r
while (!infile.eof())\r
{\r
string line;\r
- shared_ptr<MasterGO> spMaster;\r
+ boost::shared_ptr<MasterGO> spMaster;\r
getline(infile, line);\r
if (line.empty())\r
{\r
return mFilename;\r
}\r
\r
-shared_ptr<MasterGO> FileMasterDAO::GetById(const string &Id) const\r
+boost::shared_ptr<MasterGO> FileMasterDAO::GetById(const string &Id) const\r
{\r
- map<string, shared_ptr<MasterGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<MasterGO> >::const_iterator iter;\r
iter = spMasterCache.find(Id);\r
if (iter != spMasterCache.end())\r
{\r
- return shared_ptr<MasterGO>(iter->second);\r
+ return boost::shared_ptr<MasterGO>(iter->second);\r
}\r
- return shared_ptr<MasterGO>();\r
+ return boost::shared_ptr<MasterGO>();\r
}\r
\r
-void FileMasterDAO::Insert(shared_ptr<MasterGO> spMaster)\r
+void FileMasterDAO::Insert(boost::shared_ptr<MasterGO> spMaster)\r
{\r
throw DataLayerException("Not implemented", __FILE__, __LINE__);\r
}\r
-void FileMasterDAO::Update(shared_ptr<MasterGO> spMaster)\r
+void FileMasterDAO::Update(boost::shared_ptr<MasterGO> spMaster)\r
{\r
throw DataLayerException("Not implemented", __FILE__, __LINE__);\r
}\r
\r
-shared_ptr<MasterGO> FileMasterDAO::CreateMasterFromLine(const string &line) const\r
+boost::shared_ptr<MasterGO> FileMasterDAO::CreateMasterFromLine(const string &line) const\r
{\r
assert(!line.empty());\r
- shared_ptr<MasterGO> spMaster;\r
- spMaster = shared_ptr<MasterGO>(new MasterGO());\r
+ boost::shared_ptr<MasterGO> spMaster;\r
+ spMaster = boost::shared_ptr<MasterGO>(new MasterGO());\r
boost::char_separator<char> sep("~", 0);\r
tokenizer tokens(line, sep);\r
tokenizer::iterator tok_iter = tokens.begin();\r
\r
bool FileMasterDAO::IdExists(const string &Id) const\r
{\r
- map<string, shared_ptr<MasterGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<MasterGO> >::const_iterator iter;\r
iter = spMasterCache.find(Id);\r
return (iter != spMasterCache.end());\r
}
\ No newline at end of file
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::shared_static_cast;\r
using boost::format;\r
using boost::str;\r
while (!infile.eof())\r
{\r
string line;\r
- shared_ptr<MonsterGO> spMonster;\r
+ boost::shared_ptr<MonsterGO> spMonster;\r
getline(infile, line);\r
if (line.empty())\r
{\r
return mFilename;\r
}\r
\r
-shared_ptr<MonsterGO> FileMonsterDAO::GetById(const string &Id) const\r
+boost::shared_ptr<MonsterGO> FileMonsterDAO::GetById(const string &Id) const\r
{\r
- map<string, shared_ptr<MonsterGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<MonsterGO> >::const_iterator iter;\r
string id = Id;\r
to_lower(id);\r
iter = spMonsterCache.find(id);\r
if (iter != spMonsterCache.end())\r
{\r
- return shared_ptr<MonsterGO>(iter->second->Clone());\r
+ return boost::shared_ptr<MonsterGO>(iter->second->Clone());\r
}\r
- return shared_ptr<MonsterGO>();\r
+ return boost::shared_ptr<MonsterGO>();\r
}\r
\r
-void Update(shared_ptr<MonsterGO> spMonster)\r
+void Update(boost::shared_ptr<MonsterGO> spMonster)\r
{\r
throw DataLayerException("Not implemented", __FILE__, __LINE__);\r
}\r
\r
-void Insert(shared_ptr<MonsterGO> spMonster)\r
+void Insert(boost::shared_ptr<MonsterGO> spMonster)\r
{\r
throw DataLayerException("Not implemented", __FILE__, __LINE__);\r
}\r
\r
-shared_ptr<MonsterGO> FileMonsterDAO::CreateMonsterFromLine(const string &line) const\r
+boost::shared_ptr<MonsterGO> FileMonsterDAO::CreateMonsterFromLine(const string &line) const\r
{\r
assert(!line.empty());\r
- shared_ptr<MonsterGO> spMonster;\r
- spMonster = shared_ptr<MonsterGO>(new MonsterGO());\r
+ boost::shared_ptr<MonsterGO> spMonster;\r
+ spMonster = boost::shared_ptr<MonsterGO>(new MonsterGO());\r
boost::char_separator<char> sep("~", 0);\r
tokenizer tokens(line, sep);\r
tokenizer::iterator tok_iter = tokens.begin();\r
\r
bool FileMonsterDAO::IdExists(const string &Id) const\r
{\r
- map<string, shared_ptr<MonsterGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<MonsterGO> >::const_iterator iter;\r
string id = Id;\r
to_lower(id);\r
iter = spMonsterCache.find(id);\r
if (leveliter == MonsterLevelIndex.end())\r
{\r
vector<string> monsterIds;\r
- map<string, shared_ptr<MonsterGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<MonsterGO> >::const_iterator iter;\r
for (iter = spMonsterCache.begin(); iter != spMonsterCache.end(); iter++)\r
{\r
if (iter->second->LevelId() == LevelId)\r
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::shared_static_cast;\r
using boost::format;\r
using boost::str;\r
while (!infile.eof())\r
{\r
string line;\r
- shared_ptr<PlayerGO> spPlayer;\r
+ boost::shared_ptr<PlayerGO> spPlayer;\r
getline(infile, line);\r
if (line.empty())\r
{\r
to_lower(id);\r
spPlayerCache[id] = spPlayer;\r
// Load all the items into the player's inventory\r
- shared_ptr<InventoryManager> inventory = InventoryManager::Instance();\r
+ boost::shared_ptr<InventoryManager> inventory = InventoryManager::Instance();\r
if (!inventory->PlayerHasInventory(spPlayer->Id()))\r
{\r
LoadInventoryFromLine(spPlayer, line);\r
__FILE__, __LINE__);\r
}\r
\r
- map<string, shared_ptr<PlayerGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<PlayerGO> >::const_iterator iter;\r
for (iter = spPlayerCache.begin(); iter != spPlayerCache.end(); iter++)\r
{\r
outfile << CreateLineFromPlayer(iter->second) << endl;\r
return mFilename;\r
}\r
\r
-shared_ptr<PlayerGO> FilePlayerDAO::GetById(const string &Id) const\r
+boost::shared_ptr<PlayerGO> FilePlayerDAO::GetById(const string &Id) const\r
{\r
- map<string, shared_ptr<PlayerGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<PlayerGO> >::const_iterator iter;\r
string id = Id;\r
to_lower(id);\r
iter = spPlayerCache.find(id);\r
if (iter != spPlayerCache.end())\r
{\r
- return shared_ptr<PlayerGO>(iter->second->Clone());\r
+ return boost::shared_ptr<PlayerGO>(iter->second->Clone());\r
}\r
- return shared_ptr<PlayerGO>();\r
+ return boost::shared_ptr<PlayerGO>();\r
}\r
\r
-shared_ptr<PlayerGO> FilePlayerDAO::CreatePlayerFromLine(const string &line) const\r
+boost::shared_ptr<PlayerGO> FilePlayerDAO::CreatePlayerFromLine(const string &line) const\r
{\r
assert(!line.empty());\r
- shared_ptr<PlayerGO> spPlayer;\r
- spPlayer = shared_ptr<PlayerGO>(new PlayerGO());\r
+ boost::shared_ptr<PlayerGO> spPlayer;\r
+ spPlayer = boost::shared_ptr<PlayerGO>(new PlayerGO());\r
boost::char_separator<char> sep(" ", 0, boost::keep_empty_tokens);\r
tokenizer tokens(line, sep);\r
tokenizer::iterator tok_iter = tokens.begin();\r
return spPlayer;\r
}\r
\r
-void FilePlayerDAO::LoadInventoryFromLine(shared_ptr<PlayerGO> spPlayer, const string &line) const\r
+void FilePlayerDAO::LoadInventoryFromLine(boost::shared_ptr<PlayerGO> spPlayer, const string &line) const\r
{\r
assert(!line.empty());\r
boost::char_separator<char> sep(" ", 0);\r
}\r
}\r
// Load all the items into the player's inventory\r
- shared_ptr<InventoryManager> inventory = InventoryManager::Instance();\r
+ boost::shared_ptr<InventoryManager> inventory = InventoryManager::Instance();\r
FileItemDAO idao;\r
while (tok_iter != tokens.end())\r
{\r
string itemid = FileId::CreateItemId((*tok_iter));\r
- shared_ptr<ItemGO> spItem = idao.GetById(itemid);\r
+ boost::shared_ptr<ItemGO> spItem = idao.GetById(itemid);\r
tok_iter++;\r
if (tok_iter == tokens.end())\r
{\r
}\r
}\r
\r
-string FilePlayerDAO::CreateLineFromPlayer(shared_ptr<PlayerGO> spPlayer) const\r
+string FilePlayerDAO::CreateLineFromPlayer(boost::shared_ptr<PlayerGO> spPlayer) const\r
{\r
string line;\r
line = str(format("%1% %2% %3% %4% %5% %6% %7% %8% %9% %10% %11% %12% %13% %14% %15% %16%") % \r
GetFlags(spPlayer) % spPlayer->Password() % (to_iso_string(spPlayer->LastLogin())) %\r
FileId::GetItemNumberFromId(spPlayer->Weapon()->Id()) % FileId::GetItemNumberFromId(spPlayer->Armor()->Id()));\r
\r
- shared_ptr<InventoryManager> spInventory = InventoryManager::Instance();\r
+ boost::shared_ptr<InventoryManager> spInventory = InventoryManager::Instance();\r
ItemList inventory = spInventory->GetInventory(spPlayer->Id());\r
ItemList::const_iterator iter;\r
for (iter = inventory.begin(); iter != inventory.end(); iter++)\r
{\r
- shared_ptr<ItemGO> spItem = (*iter);\r
+ boost::shared_ptr<ItemGO> spItem = (*iter);\r
line += " " + FileId::GetItemNumberFromId(spItem->Id()) + " " + lexical_cast<string>(spItem->Uses());\r
}\r
\r
return line;\r
}\r
\r
-void FilePlayerDAO::SetFlags(shared_ptr<PlayerGO> spPlayer, const int &flags) const\r
+void FilePlayerDAO::SetFlags(boost::shared_ptr<PlayerGO> spPlayer, const int &flags) const\r
{\r
if ((flags & 0x00000001) == 0x00000001)\r
{\r
}\r
}\r
\r
-int FilePlayerDAO::GetFlags(shared_ptr<PlayerGO> spPlayer) const\r
+int FilePlayerDAO::GetFlags(boost::shared_ptr<PlayerGO> spPlayer) const\r
{\r
int flags = 0;\r
\r
return 0;\r
}\r
\r
-void FilePlayerDAO::Update(shared_ptr<PlayerGO> spPlayer)\r
+void FilePlayerDAO::Update(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
assert(spPlayer != 0);\r
assert(!spPlayer->Id().empty());\r
}\r
}\r
\r
-void FilePlayerDAO::Insert(shared_ptr<PlayerGO> spPlayer)\r
+void FilePlayerDAO::Insert(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
assert(spPlayer != 0);\r
assert(!spPlayer->Name().empty());\r
\r
bool FilePlayerDAO::IdExists(const string &Id) const\r
{\r
- map<string, shared_ptr<PlayerGO> >::const_iterator iter;\r
+ map<string, boost::shared_ptr<PlayerGO> >::const_iterator iter;\r
string id = Id;\r
to_lower(id);\r
iter = spPlayerCache.find(id);\r
using GameServ::DataLayer::MySQL::MySQLLevelDAO;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
MySQLDAOFactory::MySQLDAOFactory(void)\r
{\r
{\r
}\r
\r
-shared_ptr<IPlayerDAO> MySQLDAOFactory::GetPlayerDAO(void) const\r
+boost::shared_ptr<IPlayerDAO> MySQLDAOFactory::GetPlayerDAO(void) const\r
{\r
- return shared_ptr<IPlayerDAO>(new MySQLPlayerDAO());\r
+ return boost::shared_ptr<IPlayerDAO>(new MySQLPlayerDAO());\r
}\r
\r
-shared_ptr<IItemDAO> MySQLDAOFactory::GetItemDAO(void) const\r
+boost::shared_ptr<IItemDAO> MySQLDAOFactory::GetItemDAO(void) const\r
{\r
- return shared_ptr<IItemDAO>(new MySQLItemDAO());\r
+ return boost::shared_ptr<IItemDAO>(new MySQLItemDAO());\r
}\r
\r
-shared_ptr<IMonsterDAO> MySQLDAOFactory::GetMonsterDAO(void) const\r
+boost::shared_ptr<IMonsterDAO> MySQLDAOFactory::GetMonsterDAO(void) const\r
{\r
- //return shared_ptr<IMonsterDAO>(new MySQLMonsterDAO());\r
+ //return boost::shared_ptr<IMonsterDAO>(new MySQLMonsterDAO());\r
throw GameServException("Not implemented", __FILE__, __LINE__);\r
}\r
\r
-shared_ptr<IMasterDAO> MySQLDAOFactory::GetMasterDAO(void) const\r
+boost::shared_ptr<IMasterDAO> MySQLDAOFactory::GetMasterDAO(void) const\r
{\r
-// return shared_ptr<IMasterDAO>(new MySQLMasterDAO());\r
+// return boost::shared_ptr<IMasterDAO>(new MySQLMasterDAO());\r
throw GameServException("Not implemented", __FILE__, __LINE__);\r
}\r
\r
-shared_ptr<ILevelDAO> MySQLDAOFactory::GetLevelDAO(void) const\r
+boost::shared_ptr<ILevelDAO> MySQLDAOFactory::GetLevelDAO(void) const\r
{\r
-// return shared_ptr<ILevelDAO>(new MySQLLevelDAO());\r
+// return boost::shared_ptr<ILevelDAO>(new MySQLLevelDAO());\r
throw GameServException("Not implemented", __FILE__, __LINE__);\r
}\r
\r
using GameServ::Types::Modifiers;\r
using GameServ::Types::Exceptions::TypeException;\r
\r
-#include <boost/shared_ptr.hpp>\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::format;\r
using boost::str;\r
using boost::algorithm::to_upper;\r
mysqlpp::sql_int, maxhealthhigh,\r
mysqlpp::sql_int, maxhealthlow);\r
\r
-shared_ptr<ItemGO> CreateItemFromItemSSQLS(const item &i);\r
-item CreateItemSSQLSFromItem(shared_ptr<ItemGO> spItem);\r
+boost::shared_ptr<ItemGO> CreateItemFromItemSSQLS(const item &i);\r
+item CreateItemSSQLSFromItem(boost::shared_ptr<ItemGO> spItem);\r
\r
MySQLItemDAO::MySQLItemDAO()\r
{\r
mTableName = tablename;\r
}\r
\r
-shared_ptr<ItemGO> MySQLItemDAO::GetById(const string &Id) const\r
+boost::shared_ptr<ItemGO> MySQLItemDAO::GetById(const string &Id) const\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
else if (items.size() == 0)\r
{\r
- return shared_ptr<ItemGO>();\r
+ return boost::shared_ptr<ItemGO>();\r
}\r
else\r
{\r
}\r
\r
\r
-void MySQLItemDAO::Insert(shared_ptr<ItemGO> spItem)\r
+void MySQLItemDAO::Insert(boost::shared_ptr<ItemGO> spItem)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
spItem->Number(query.insert_id());\r
}\r
\r
-void MySQLItemDAO::Update(shared_ptr<ItemGO> spItem)\r
+void MySQLItemDAO::Update(boost::shared_ptr<ItemGO> spItem)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
}\r
\r
-shared_ptr<ItemGO> CreateItemFromItemSSQLS(const item &i)\r
+boost::shared_ptr<ItemGO> CreateItemFromItemSSQLS(const item &i)\r
{\r
- shared_ptr<ItemGO> spItem;\r
+ boost::shared_ptr<ItemGO> spItem;\r
\r
ItemTypes::ItemType type = ItemTypes::Parse(i.type);\r
\r
switch (type)\r
{\r
case ItemTypes::Armor:\r
- spItem = shared_ptr<ArmorGO>(new ArmorGO());\r
+ spItem = boost::shared_ptr<ArmorGO>(new ArmorGO());\r
break;\r
case ItemTypes::Weapon:\r
- spItem = shared_ptr<WeaponGO>(new WeaponGO());\r
+ spItem = boost::shared_ptr<WeaponGO>(new WeaponGO());\r
break;\r
case ItemTypes::Potion:\r
- spItem = shared_ptr<PotionGO>(new PotionGO());\r
+ spItem = boost::shared_ptr<PotionGO>(new PotionGO());\r
break;\r
case ItemTypes::NOTYPE:\r
default:\r
spItem->Id(MySQLId::CreateItemId(i.id));\r
spItem->Name(i.name);\r
spItem->Uses(i.startinguses);\r
- map<Modifiers::Modifier, Range<int> > modifiers;\r
- modifiers[Modifiers::strength] = Range<int>(i.strengthhigh, i.strengthlow);\r
- modifiers[Modifiers::defense] = Range<int>(i.defensehigh, i.defenselow);\r
- modifiers[Modifiers::bank] = Range<int>(i.bankhigh, i.banklow);\r
- modifiers[Modifiers::gold] = Range<int>(i.goldhigh, i.goldlow);\r
- modifiers[Modifiers::forestfights] = Range<int>(i.forestfightshigh, i.forestfightslow);\r
- modifiers[Modifiers::health] = Range<int>(i.healthhigh, i.healthlow);\r
- modifiers[Modifiers::maxhealth] = Range<int>(i.maxhealthhigh, i.maxhealthlow);\r
- modifiers[Modifiers::playerfights] = Range<int>(i.playerfightshigh, i.playerfightslow);\r
- modifiers[Modifiers::experience] = Range<int>(i.experiencehigh, i.experiencelow);\r
+ map<Modifiers::Modifier, IntRange> modifiers;\r
+ modifiers[Modifiers::strength] = IntRange(i.strengthhigh, i.strengthlow);\r
+ modifiers[Modifiers::defense] = IntRange(i.defensehigh, i.defenselow);\r
+ modifiers[Modifiers::bank] = IntRange(i.bankhigh, i.banklow);\r
+ modifiers[Modifiers::gold] = IntRange(i.goldhigh, i.goldlow);\r
+ modifiers[Modifiers::forestfights] = IntRange(i.forestfightshigh, i.forestfightslow);\r
+ modifiers[Modifiers::health] = IntRange(i.healthhigh, i.healthlow);\r
+ modifiers[Modifiers::maxhealth] = IntRange(i.maxhealthhigh, i.maxhealthlow);\r
+ modifiers[Modifiers::playerfights] = IntRange(i.playerfightshigh, i.playerfightslow);\r
+ modifiers[Modifiers::experience] = IntRange(i.experiencehigh, i.experiencelow);\r
\r
\r
spItem->Modifiers(modifiers);\r
\r
return spItem;\r
}\r
-item CreateItemSSQLSFromItem(shared_ptr<ItemGO> spItem)\r
+item CreateItemSSQLSFromItem(boost::shared_ptr<ItemGO> spItem)\r
{\r
item i;\r
i.name = spItem->Name();\r
- map<Modifiers::Modifier, Range<int> > modifiers = spItem->Modifiers();\r
+ map<Modifiers::Modifier, IntRange> modifiers = spItem->Modifiers();\r
i.strengthhigh = modifiers[Modifiers::strength].High();\r
i.strengthlow = modifiers[Modifiers::strength].Low();\r
i.defensehigh = modifiers[Modifiers::defense].High();\r
#include <GameServ/DataLayer/MySQL/MySQLId.h>\r
using GameServ::DataLayer::MySQL::MySQLId;\r
\r
-#include <boost/shared_ptr.hpp>\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::shared_static_cast;\r
using boost::format;\r
using boost::str;\r
mysqlpp::sql_int, healthhigh,\r
mysqlpp::sql_int, healthlow);\r
\r
-shared_ptr<LevelGO> CreateLevelFromLevelSSQLS(const level &l);\r
-level CreateLevelSSQLSFromLevel(shared_ptr<LevelGO> spLevel);\r
+boost::shared_ptr<LevelGO> CreateLevelFromLevelSSQLS(const level &l);\r
+level CreateLevelSSQLSFromLevel(boost::shared_ptr<LevelGO> spLevel);\r
\r
MySQLLevelDAO::MySQLLevelDAO()\r
{\r
mTableName = tablename;\r
}\r
\r
-shared_ptr<LevelGO> MySQLLevelDAO::GetById(const string &Id) const\r
+boost::shared_ptr<LevelGO> MySQLLevelDAO::GetById(const string &Id) const\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
else if (levels.size() == 0)\r
{\r
- return shared_ptr<LevelGO>();\r
+ return boost::shared_ptr<LevelGO>();\r
}\r
else\r
{\r
}\r
\r
\r
-void MySQLLevelDAO::Insert(shared_ptr<LevelGO> spLevel)\r
+void MySQLLevelDAO::Insert(boost::shared_ptr<LevelGO> spLevel)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
spLevel->Id(MySQLId::CreateLevelId(query.insert_id()));\r
}\r
\r
-void MySQLLevelDAO::Update(shared_ptr<LevelGO> spLevel)\r
+void MySQLLevelDAO::Update(boost::shared_ptr<LevelGO> spLevel)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
}\r
\r
-shared_ptr<LevelGO> CreateLevelFromLevelSSQLS(const level &l)\r
+boost::shared_ptr<LevelGO> CreateLevelFromLevelSSQLS(const level &l)\r
{\r
- shared_ptr<LevelGO> spLevel = shared_ptr<LevelGO>(new LevelGO());\r
+ boost::shared_ptr<LevelGO> spLevel = boost::shared_ptr<LevelGO>(new LevelGO());\r
\r
spLevel->Id(MySQLId::CreateLevelId(l.id));\r
- spLevel->StrengthRange(Range<int>(l.strengthhigh, l.strengthlow));\r
- spLevel->DefenseRange(Range<int>(l.defensehigh, l.defenselow));\r
- spLevel->GoldRange(Range<int>(l.goldhigh, l.goldlow));\r
- spLevel->ExperienceRange(Range<int>(l.experiencehigh, l.experiencelow));\r
- spLevel->HealthRange(Range<int>(l.healthhigh, l.healthlow));\r
+ spLevel->StrengthRange(IntRange(l.strengthhigh, l.strengthlow));\r
+ spLevel->DefenseRange(IntRange(l.defensehigh, l.defenselow));\r
+ spLevel->GoldRange(IntRange(l.goldhigh, l.goldlow));\r
+ spLevel->ExperienceRange(IntRange(l.experiencehigh, l.experiencelow));\r
+ spLevel->HealthRange(IntRange(l.healthhigh, l.healthlow));\r
\r
return spLevel;\r
}\r
-level CreateLevelSSQLSFromLevel(shared_ptr<LevelGO> spLevel)\r
+level CreateLevelSSQLSFromLevel(boost::shared_ptr<LevelGO> spLevel)\r
{\r
assert (spLevel != 0);\r
\r
#include <GameServ/DataLayer/MySQL/MySQLId.h>\r
using GameServ::DataLayer::MySQL::MySQLId;\r
\r
-#include <boost/shared_ptr.hpp>\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::format;\r
using boost::str;\r
using boost::algorithm::to_upper;\r
mysqlpp::sql_int_unsigned, health,\r
mysqlpp::sql_varchar, partingwords);\r
\r
-shared_ptr<MasterGO> CreateMasterFromMasterSSQLS(const master &m);\r
-master CreateMasterSSQLSFromMaster(shared_ptr<MasterGO> spMaster);\r
+boost::shared_ptr<MasterGO> CreateMasterFromMasterSSQLS(const master &m);\r
+master CreateMasterSSQLSFromMaster(boost::shared_ptr<MasterGO> spMaster);\r
\r
MySQLMasterDAO::MySQLMasterDAO()\r
{\r
mTableName = tablename;\r
}\r
\r
-shared_ptr<MasterGO> MySQLMasterDAO::GetById(const string &Id) const\r
+boost::shared_ptr<MasterGO> MySQLMasterDAO::GetById(const string &Id) const\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
else if (masters.size() == 0)\r
{\r
- return shared_ptr<MasterGO>();\r
+ return boost::shared_ptr<MasterGO>();\r
}\r
else\r
{\r
}\r
\r
\r
-void MySQLMasterDAO::Insert(shared_ptr<MasterGO> spMaster)\r
+void MySQLMasterDAO::Insert(boost::shared_ptr<MasterGO> spMaster)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
spMaster->Id(MySQLId::CreateMasterId(query.insert_id()));\r
}\r
\r
-void MySQLMasterDAO::Update(shared_ptr<MasterGO> spMaster)\r
+void MySQLMasterDAO::Update(boost::shared_ptr<MasterGO> spMaster)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
}\r
\r
-shared_ptr<MasterGO> CreateMasterFromMasterSSQLS(const master &m)\r
+boost::shared_ptr<MasterGO> CreateMasterFromMasterSSQLS(const master &m)\r
{\r
- shared_ptr<MasterGO> spMaster = shared_ptr<MasterGO>(new MasterGO());\r
+ boost::shared_ptr<MasterGO> spMaster = boost::shared_ptr<MasterGO>(new MasterGO());\r
\r
spMaster->Id(MySQLId::CreateMasterId(m.id));\r
spMaster->Name(m.name);\r
\r
return spMaster;\r
}\r
-master CreateMasterSSQLSFromMaster(shared_ptr<MasterGO> spMaster)\r
+master CreateMasterSSQLSFromMaster(boost::shared_ptr<MasterGO> spMaster)\r
{\r
master m;\r
\r
#include <GameServ/DataLayer/MySQL/MySQLId.h>\r
using GameServ::DataLayer::MySQL::MySQLId;\r
\r
-#include <boost/shared_ptr.hpp>\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::format;\r
using boost::str;\r
using boost::algorithm::to_upper;\r
mysqlpp::sql_varchar, deathcry);\r
\r
\r
-shared_ptr<MonsterGO> CreateMonsterFromMonsterSSQLS(const monster &m);\r
-monster CreateMonsterSSQLSFromMonster(shared_ptr<MonsterGO> spMonster);\r
+boost::shared_ptr<MonsterGO> CreateMonsterFromMonsterSSQLS(const monster &m);\r
+monster CreateMonsterSSQLSFromMonster(boost::shared_ptr<MonsterGO> spMonster);\r
\r
MySQLMonsterDAO::MySQLMonsterDAO()\r
{\r
mTableName = tablename;\r
}\r
\r
-shared_ptr<MonsterGO> MySQLMonsterDAO::GetById(const string &Id) const\r
+boost::shared_ptr<MonsterGO> MySQLMonsterDAO::GetById(const string &Id) const\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
else if (monsters.size() == 0)\r
{\r
- return shared_ptr<MonsterGO>();\r
+ return boost::shared_ptr<MonsterGO>();\r
}\r
else\r
{\r
}\r
\r
\r
-void MySQLMonsterDAO::Insert(shared_ptr<MonsterGO> spMonster)\r
+void MySQLMonsterDAO::Insert(boost::shared_ptr<MonsterGO> spMonster)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
spMonster->Id(MySQLId::CreateMonsterId(query.insert_id()));\r
}\r
\r
-void MySQLMonsterDAO::Update(shared_ptr<MonsterGO> spMonster)\r
+void MySQLMonsterDAO::Update(boost::shared_ptr<MonsterGO> spMonster)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
}\r
\r
-shared_ptr<MonsterGO> CreateMonsterFromMonsterSSQLS(const monster &m)\r
+boost::shared_ptr<MonsterGO> CreateMonsterFromMonsterSSQLS(const monster &m)\r
{\r
- shared_ptr<MonsterGO> spMonster = shared_ptr<MonsterGO>(new MonsterGO());\r
+ boost::shared_ptr<MonsterGO> spMonster = boost::shared_ptr<MonsterGO>(new MonsterGO());\r
\r
spMonster->Id(MySQLId::CreateMonsterId(m.id));\r
spMonster->Name(m.name);\r
\r
return spMonster;\r
}\r
-monster CreateMonsterSSQLSFromMonster(shared_ptr<MonsterGO> spMonster)\r
+monster CreateMonsterSSQLSFromMonster(boost::shared_ptr<MonsterGO> spMonster)\r
{\r
monster m;\r
\r
#include <GameServ/DataLayer/MySQL/MySQLId.h>\r
using GameServ::DataLayer::MySQL::MySQLId;\r
\r
-#include <boost/shared_ptr.hpp>\r
+#include <boost/smart_ptr/shared_ptr.hpp>\r
#include <boost/format.hpp>\r
#include <boost/algorithm/string.hpp>\r
#include <boost/lexical_cast.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::shared_static_cast;\r
using boost::format;\r
using boost::str;\r
mysqlpp::sql_boolean, foughtmaster);\r
\r
\r
-shared_ptr<PlayerGO> CreatePlayerFromPlayerSSQLS(const player &p);\r
-player CreatePlayerSSQLSFromPlayer(shared_ptr<PlayerGO> spPlayer);\r
+boost::shared_ptr<PlayerGO> CreatePlayerFromPlayerSSQLS(const player &p);\r
+player CreatePlayerSSQLSFromPlayer(boost::shared_ptr<PlayerGO> spPlayer);\r
\r
MySQLPlayerDAO::MySQLPlayerDAO()\r
{\r
mTableName = tablename;\r
}\r
\r
-shared_ptr<PlayerGO> MySQLPlayerDAO::GetById(const string &Id) const\r
+boost::shared_ptr<PlayerGO> MySQLPlayerDAO::GetById(const string &Id) const\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
else if (players.size() == 0)\r
{\r
- return shared_ptr<PlayerGO>();\r
+ return boost::shared_ptr<PlayerGO>();\r
}\r
else\r
{\r
}\r
\r
\r
-void MySQLPlayerDAO::Insert(shared_ptr<PlayerGO> spPlayer)\r
+void MySQLPlayerDAO::Insert(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
spPlayer->Id(MySQLId::CreatePlayerId(query.insert_id()));\r
}\r
\r
-void MySQLPlayerDAO::Update(shared_ptr<PlayerGO> spPlayer)\r
+void MySQLPlayerDAO::Update(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
// TODO: Enable and catch exceptions\r
mysqlpp::Connection conn;\r
}\r
}\r
\r
-shared_ptr<PlayerGO> CreatePlayerFromPlayerSSQLS(const player &p)\r
+boost::shared_ptr<PlayerGO> CreatePlayerFromPlayerSSQLS(const player &p)\r
{\r
- shared_ptr<PlayerGO> spPlayer = shared_ptr<PlayerGO>(new PlayerGO());\r
+ boost::shared_ptr<PlayerGO> spPlayer = boost::shared_ptr<PlayerGO>(new PlayerGO());\r
\r
spPlayer->Id(MySQLId::CreatePlayerId(p.id));\r
spPlayer->Name(p.name);\r
\r
return spPlayer;\r
}\r
-player CreatePlayerSSQLSFromPlayer(shared_ptr<PlayerGO> spPlayer)\r
+player CreatePlayerSSQLSFromPlayer(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
player p;\r
p.name = spPlayer->Name();\r
using GameServ::DataLayer::IDAOFactory;\r
\r
#include <GameServ/Types.h>\r
-using GameServ::Types::Range;\r
+using GameServ::Types::UIntRange;\r
using GameServ::Types::Modifiers;\r
\r
FightGL::FightGL()\r
void FightGL::Initialize()\r
{\r
// TODO: Load from config\r
- shared_ptr<IDAOFactory> factory = DataAccess::GetDataAccessFactory("File");\r
+ boost::shared_ptr<IDAOFactory> factory = DataAccess::GetDataAccessFactory("File");\r
mspPlayerDAO = factory->GetPlayerDAO();\r
}\r
\r
-unsigned int FightGL::PlayerAttackMonster(shared_ptr<PlayerGO> spPlayer, shared_ptr<MonsterGO> spMonster)\r
+unsigned int FightGL::PlayerAttackMonster(boost::shared_ptr<PlayerGO> spPlayer, boost::shared_ptr<MonsterGO> spMonster)\r
{\r
unsigned int attack = CalculateAttack(spPlayer->Strength(), spMonster->Defense());\r
if (attack >= spMonster->Health())\r
return attack;\r
}\r
\r
-unsigned int FightGL::MonsterAttackPlayer(shared_ptr<MonsterGO> spMonster, shared_ptr<PlayerGO> spPlayer)\r
+unsigned int FightGL::MonsterAttackPlayer(boost::shared_ptr<MonsterGO> spMonster, boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
unsigned int attack = CalculateAttack(spMonster->Strength(), spPlayer->Defense());\r
if (attack >= spPlayer->Health())\r
return attack;\r
}\r
\r
-unsigned int FightGL::PlayerAttackPlayer(shared_ptr<PlayerGO> spPlayerAttacker, shared_ptr<PlayerGO> spPlayerDefender)\r
+unsigned int FightGL::PlayerAttackPlayer(boost::shared_ptr<PlayerGO> spPlayerAttacker, boost::shared_ptr<PlayerGO> spPlayerDefender)\r
{\r
unsigned int attack = CalculateAttack(spPlayerAttacker->Strength(), spPlayerDefender->Defense());\r
if (attack >= spPlayerDefender->Health())\r
{\r
return 0;\r
}\r
- Range<unsigned int> r(strength, strength / 2);\r
+ UIntRange r(strength, strength / 2);\r
if (r.Random() <= defense)\r
{\r
return 0;\r
using GameServ::GameLayer::GameObjects::PlayerGO;\r
using GameServ::GameLayer::GameObjects::MonsterGO;\r
\r
+#include <GameServ/Types.h>\r
+using GameServ::Types::UIntRange;\r
+\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <string>\r
using std::string;\r
void ForestGL::Initialize(void)\r
{\r
// TODO: Change this to be loaded from a config file\r
- shared_ptr<IDAOFactory> spFactory = DataAccess::GetDataAccessFactory("File");\r
+ boost::shared_ptr<IDAOFactory> spFactory = DataAccess::GetDataAccessFactory("File");\r
\r
mspMonsterDAO = spFactory->GetMonsterDAO();\r
mspLevelDAO = spFactory->GetLevelDAO();\r
}\r
\r
-shared_ptr<MonsterGO> ForestGL::GetRandomMonsterForPlayer(shared_ptr<PlayerGO> spPlayer)\r
+boost::shared_ptr<MonsterGO> ForestGL::GetRandomMonsterForPlayer(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
assert (spPlayer != 0);\r
- shared_ptr<LevelGO> spLevel = mspLevelDAO->GetById(spPlayer->LevelId());\r
+ boost::shared_ptr<LevelGO> spLevel = mspLevelDAO->GetById(spPlayer->LevelId());\r
vector<string> monsterIds = mspMonsterDAO->GetMonsterIdsByLevelId(spLevel->Id());\r
if (monsterIds.size() > 0)\r
{\r
- Range<unsigned int> r(monsterIds.size() - 1, 0);\r
- shared_ptr<MonsterGO> spMonster = mspMonsterDAO->GetById(monsterIds[r.Random()]);\r
+ UIntRange r(monsterIds.size() - 1, 0);\r
+ boost::shared_ptr<MonsterGO> spMonster = mspMonsterDAO->GetById(monsterIds[r.Random()]);\r
spMonster->MaxHealth(spLevel->HealthRange().Random());\r
spMonster->Health(spMonster->MaxHealth());\r
spMonster->Strength(spLevel->StrengthRange().Random());\r
spMonster->Experience(spLevel->ExperienceRange().Random());\r
return spMonster;\r
}\r
- return shared_ptr<MonsterGO>();\r
+ return boost::shared_ptr<MonsterGO>();\r
}\r
mPrice = price;\r
mUses = uses;\r
mModifiers.clear();\r
- mModifiers[Modifiers::strength] = Range<int>(strength, strength);\r
- mModifiers[Modifiers::defense] = Range<int>(defense, defense);\r
- mModifiers[Modifiers::maxhealth] = Range<int>(maxhealth, maxhealth);\r
+ mModifiers[Modifiers::strength] = IntRange(strength, strength);\r
+ mModifiers[Modifiers::defense] = IntRange(defense, defense);\r
+ mModifiers[Modifiers::maxhealth] = IntRange(maxhealth, maxhealth);\r
}\r
\r
ArmorGO::~ArmorGO()\r
using std::string;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
GameObject::GameObject(void) : mId()\r
{\r
{\r
}\r
\r
-bool GameObjectIds_Eq::operator ()(const shared_ptr<GameObject> &BO) const\r
+bool GameObjectIds_Eq::operator ()(const boost::shared_ptr<GameObject> &BO) const\r
{\r
return mId == BO->mId;\r
}\r
#include <GameServ/Types.h>\r
using GameServ::Types::ItemTypes;\r
using GameServ::Types::Modifiers;\r
-using GameServ::Types::Range;\r
+using GameServ::Types::IntRange;\r
using GameServ::Types::ObjectTypes;\r
\r
#include <GameServ/GameServException.h>\r
using std::map;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::shared_static_cast;\r
\r
#include <boost/algorithm/string.hpp>\r
mUses = value;\r
}\r
\r
-void ItemGO::Use(shared_ptr<GameObject> spObject)\r
+void ItemGO::Use(boost::shared_ptr<GameObject> spObject)\r
{\r
- map<Modifiers::Modifier, Range<int> >::const_iterator iter;\r
+ map<Modifiers::Modifier, IntRange>::const_iterator iter;\r
for (iter = mModifiers.begin(); iter != mModifiers.end(); iter++)\r
{\r
ApplyModifier(spObject, iter->first, iter->second);\r
}\r
}\r
\r
-void ItemGO::Undo(shared_ptr<GameObject> spObject)\r
+void ItemGO::Undo(boost::shared_ptr<GameObject> spObject)\r
{\r
- map<Modifiers::Modifier, Range<int> >::const_iterator iter;\r
+ map<Modifiers::Modifier, IntRange>::const_iterator iter;\r
for (iter = mModifiers.begin(); iter != mModifiers.end(); iter++)\r
{\r
UndoModifier(spObject, iter->first, iter->second);\r
}\r
}\r
\r
-void ItemGO::ApplyModifier(shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, Range<int> r)\r
+void ItemGO::ApplyModifier(boost::shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, IntRange r)\r
{\r
if (spObject->ObjectType() != ObjectTypes::Player)\r
{\r
Id() % Name() % ObjectTypes::GetName(spObject->ObjectType())), __FILE__, __LINE__);\r
}\r
\r
- shared_ptr<PlayerGO> spPlayer = shared_static_cast<PlayerGO>(spObject);\r
+ boost::shared_ptr<PlayerGO> spPlayer = shared_static_cast<PlayerGO>(spObject);\r
\r
switch (modifier)\r
{\r
}\r
}\r
\r
-void ItemGO::UndoModifier(shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, Range<int> r)\r
+void ItemGO::UndoModifier(boost::shared_ptr<GameObject> spObject, const Modifiers::Modifier &modifier, IntRange r)\r
{\r
if (spObject->ObjectType() != ObjectTypes::Player)\r
{\r
Id() % Name() % ObjectTypes::GetName(spObject->ObjectType())), __FILE__, __LINE__);\r
}\r
\r
- shared_ptr<PlayerGO> spPlayer = shared_static_cast<PlayerGO>(spObject);\r
+ boost::shared_ptr<PlayerGO> spPlayer = shared_static_cast<PlayerGO>(spObject);\r
\r
switch (modifier)\r
{\r
}\r
}\r
\r
-map<Modifiers::Modifier, Range<int> > ItemGO::Modifiers(void) const\r
+map<Modifiers::Modifier, IntRange> ItemGO::Modifiers(void) const\r
{\r
return mModifiers;\r
}\r
\r
-void ItemGO::Modifiers(const map<Modifiers::Modifier, Range<int> > &modifiers)\r
+void ItemGO::Modifiers(const map<Modifiers::Modifier, IntRange> &modifiers)\r
{\r
mModifiers.clear();\r
mModifiers.insert(modifiers.begin(), modifiers.end());\r
return mNumber;\r
}\r
\r
-void LevelGO::StrengthRange(const Range<int> &value)\r
+void LevelGO::StrengthRange(const IntRange&value)\r
{\r
mStrength = value;\r
}\r
\r
-Range<int> LevelGO::StrengthRange(void) const\r
+IntRange LevelGO::StrengthRange(void) const\r
{\r
return mStrength;\r
}\r
\r
-void LevelGO::DefenseRange(const Range<int> &value)\r
+void LevelGO::DefenseRange(const IntRange&value)\r
{\r
mDefense = value;\r
}\r
\r
-Range<int> LevelGO::DefenseRange(void) const\r
+IntRange LevelGO::DefenseRange(void) const\r
{\r
return mDefense;\r
}\r
\r
-void LevelGO::GoldRange(const Range<int> &value)\r
+void LevelGO::GoldRange(const IntRange&value)\r
{\r
mGold = value;\r
}\r
\r
-Range<int> LevelGO::GoldRange(void) const\r
+IntRange LevelGO::GoldRange(void) const\r
{\r
return mGold;\r
}\r
\r
-void LevelGO::ExperienceRange(const Range<int> &value)\r
+void LevelGO::ExperienceRange(const IntRange&value)\r
{\r
mExperience = value;\r
}\r
\r
-Range<int> LevelGO::ExperienceRange(void) const\r
+IntRange LevelGO::ExperienceRange(void) const\r
{\r
return mExperience;\r
}\r
\r
-void LevelGO::HealthRange(const Range<int> &value)\r
+void LevelGO::HealthRange(const IntRange&value)\r
{\r
mHealth = value;\r
}\r
\r
-Range<int> LevelGO::HealthRange(void) const\r
+IntRange LevelGO::HealthRange(void) const\r
{\r
return mHealth;\r
}\r
using GameServ::Types::ObjectTypes;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
using boost::shared_static_cast;\r
\r
#include <boost/algorithm/string.hpp>\r
{\r
if (mfkWeaponId != mWeapon->Id())\r
{\r
- mWeapon = shared_ptr<WeaponGO>();\r
+ mWeapon = boost::shared_ptr<WeaponGO>();\r
}\r
}\r
}\r
\r
-shared_ptr<WeaponGO> PlayerGO::Weapon(void) const\r
+boost::shared_ptr<WeaponGO> PlayerGO::Weapon(void) const\r
{\r
return mWeapon;\r
}\r
\r
-void PlayerGO::Weapon(shared_ptr<WeaponGO> spWeapon)\r
+void PlayerGO::Weapon(boost::shared_ptr<WeaponGO> spWeapon)\r
{\r
mWeapon = spWeapon;\r
if (mWeapon != 0)\r
{\r
if (mfkArmorId != mArmor->Id())\r
{\r
- mArmor = shared_ptr<ArmorGO>();\r
+ mArmor = boost::shared_ptr<ArmorGO>();\r
}\r
}\r
}\r
\r
-shared_ptr<ArmorGO> PlayerGO::Armor(void) const\r
+boost::shared_ptr<ArmorGO> PlayerGO::Armor(void) const\r
{\r
return mArmor;\r
}\r
\r
-void PlayerGO::Armor(shared_ptr<ArmorGO> spArmor)\r
+void PlayerGO::Armor(boost::shared_ptr<ArmorGO> spArmor)\r
{\r
mArmor = spArmor;\r
if (mArmor != 0)\r
mPrice = price;\r
mUses = uses;\r
mModifiers.clear();\r
- mModifiers[Modifiers::strength] = Range<int>(strength, strength);\r
- mModifiers[Modifiers::defense] = Range<int>(defense, defense);\r
- mModifiers[Modifiers::maxhealth] = Range<int>(maxhealth, maxhealth);\r
+ mModifiers[Modifiers::strength] = IntRange(strength, strength);\r
+ mModifiers[Modifiers::defense] = IntRange(defense, defense);\r
+ mModifiers[Modifiers::maxhealth] = IntRange(maxhealth, maxhealth);\r
}\r
\r
PotionGO::~PotionGO()\r
mPrice = price;\r
mUses = uses;\r
mModifiers.clear();\r
- mModifiers[Modifiers::strength] = Range<int>(strength, strength);\r
- mModifiers[Modifiers::defense] = Range<int>(defense, defense);\r
- mModifiers[Modifiers::maxhealth] = Range<int>(maxhealth, maxhealth);\r
+ mModifiers[Modifiers::strength] = IntRange(strength, strength);\r
+ mModifiers[Modifiers::defense] = IntRange(defense, defense);\r
+ mModifiers[Modifiers::maxhealth] = IntRange(maxhealth, maxhealth);\r
}\r
\r
WeaponGO::~WeaponGO()\r
using namespace GameServ::GameLayer::Helpers;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
#include <list>\r
#include <map>\r
#include <algorithm>\r
using std::find;\r
\r
-shared_ptr<InventoryManager> InventoryManager::mInstance = shared_ptr<InventoryManager>();\r
+boost::shared_ptr<InventoryManager> InventoryManager::mInstance = boost::shared_ptr<InventoryManager>();\r
\r
InventoryManager::InventoryManager()\r
{\r
mInstance.reset();\r
}\r
\r
-shared_ptr<InventoryManager> InventoryManager::Instance(void)\r
+boost::shared_ptr<InventoryManager> InventoryManager::Instance(void)\r
{\r
if (mInstance == 0)\r
{\r
- mInstance = shared_ptr<InventoryManager>(new InventoryManager());\r
+ mInstance = boost::shared_ptr<InventoryManager>(new InventoryManager());\r
}\r
return mInstance;\r
}\r
\r
-void InventoryManager::AddItem(const string &PlayerId, shared_ptr<ItemGO> spItem)\r
+void InventoryManager::AddItem(const string &PlayerId, boost::shared_ptr<ItemGO> spItem)\r
{\r
mInventoryTable[PlayerId].push_back(spItem);\r
}\r
\r
-void InventoryManager::RemoveItem(const string &PlayerId, shared_ptr<ItemGO> spItem)\r
+void InventoryManager::RemoveItem(const string &PlayerId, boost::shared_ptr<ItemGO> spItem)\r
{\r
assert(spItem != 0);\r
PlayerInventoryMap::const_iterator iter = mInventoryTable.find(PlayerId);\r
\r
PlayerGL::~PlayerGL()\r
{\r
- mspPlayerDAO = shared_ptr<IPlayerDAO>();\r
+ mspPlayerDAO = boost::shared_ptr<IPlayerDAO>();\r
}\r
\r
void PlayerGL::Initialize()\r
{\r
- shared_ptr<IDAOFactory> spDAOFactory;\r
+ boost::shared_ptr<IDAOFactory> spDAOFactory;\r
// TODO: Hard coded for now for POC. Get from a config file\r
- spDAOFactory = shared_ptr<IDAOFactory>(DataAccess::GetDataAccessFactory("File"));\r
+ spDAOFactory = boost::shared_ptr<IDAOFactory>(DataAccess::GetDataAccessFactory("File"));\r
mspPlayerDAO = spDAOFactory->GetPlayerDAO();\r
\r
}\r
\r
-shared_ptr<PlayerGO> PlayerGL::GetById(const string &Id)\r
+boost::shared_ptr<PlayerGO> PlayerGL::GetById(const string &Id)\r
{\r
assert(!Id.empty());\r
return mspPlayerDAO->GetById(Id);\r
}\r
\r
-void PlayerGL::Insert(shared_ptr<PlayerGO> spPlayer)\r
+void PlayerGL::Insert(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
assert(spPlayer != 0);\r
mspPlayerDAO->Insert(spPlayer);\r
using GameServ::Exceptions::GameServException;\r
\r
#include <GameServ/Types.h>\r
-using GameServ::Types::Range;\r
+using GameServ::Types::IntRange;\r
using GameServ::Types::ItemTypes;\r
using GameServ::Types::Modifiers;\r
\r
using boost::format;\r
\r
#include <boost/smart_ptr/shared_ptr.hpp>\r
-using boost::shared_ptr;\r
+\r
\r
// just to test\r
#include <GameServ/DataLayer/MySQL/MySQLPlayerDAO.h>\r
#include <GameServ/DataLayer/MySQL/MySQLItemDAO.h>\r
using GameServ::DataLayer::MySQL::MySQLItemDAO;\r
\r
-string ItemInfo(shared_ptr<ItemGO> spItem);\r
-string MonsterInfo(shared_ptr<MonsterGO> spMonster);\r
-string PlayerInfo(shared_ptr<PlayerGO> spPlayer);\r
-void DisplayMonster(shared_ptr<MonsterGO> spMonster);\r
-void DisplayPlayer(shared_ptr<PlayerGO> spPlayer);\r
+string ItemInfo(boost::shared_ptr<ItemGO> spItem);\r
+string MonsterInfo(boost::shared_ptr<MonsterGO> spMonster);\r
+string PlayerInfo(boost::shared_ptr<PlayerGO> spPlayer);\r
+void DisplayMonster(boost::shared_ptr<MonsterGO> spMonster);\r
+void DisplayPlayer(boost::shared_ptr<PlayerGO> spPlayer);\r
\r
int main()\r
{\r
try\r
{\r
//PlayerGL pgl;\r
- //shared_ptr<PlayerGO> spPlayer = pgl.GetById("Kain");\r
+ //boost::shared_ptr<PlayerGO> spPlayer = pgl.GetById("Kain");\r
//\r
//\r
//\r
\r
\r
\r
- //shared_ptr<InventoryManager> spInventory = InventoryManager::Instance();\r
+ //boost::shared_ptr<InventoryManager> spInventory = InventoryManager::Instance();\r
//ItemList inventory = spInventory->GetInventory(spPlayer);\r
//ItemList::const_iterator iter;\r
//for (iter = inventory.begin(); iter != inventory.end(); iter++)\r
//{\r
- // shared_ptr<ItemGO> spItem = (*iter);\r
+ // boost::shared_ptr<ItemGO> spItem = (*iter);\r
// cout << ItemInfo(spItem) << endl;\r
//}\r
\r
// if (cmd == "search")\r
// {\r
// //cout << "Searching the forest..." << endl;\r
- // shared_ptr<MonsterGO> spMonster = forestGL.GetRandomMonsterForPlayer(spPlayer);\r
+ // boost::shared_ptr<MonsterGO> spMonster = forestGL.GetRandomMonsterForPlayer(spPlayer);\r
// \r
// while (spPlayer->Alive() && spMonster->Alive())\r
// {\r
\r
\r
MySQLItemDAO test;\r
- shared_ptr<ItemGO> spItem = test.GetById("3");\r
+ boost::shared_ptr<ItemGO> spItem = test.GetById("3");\r
spItem->Name("Testin' again!!");\r
+ \r
test.Insert(spItem);\r
\r
MySQLPlayerDAO playerTest;\r
//int x;\r
//for (x = 0; x < 10000; x++)\r
//{\r
- // Range testrange(-100, 100);\r
+ // IntRangetestrange(-100, 100);\r
// int randnum = testrange.Random();\r
// frequencies[randnum]++;\r
//}\r
return 0;\r
}\r
\r
-string ItemInfo(shared_ptr<ItemGO> spItem)\r
+string ItemInfo(boost::shared_ptr<ItemGO> spItem)\r
{\r
return str(format("Name: %1% Type: %2%") % spItem->Name() % ItemTypes::GetName(spItem->Type()));\r
}\r
\r
-string MonsterInfo(shared_ptr<MonsterGO> spMonster)\r
+string MonsterInfo(boost::shared_ptr<MonsterGO> spMonster)\r
{\r
string info = str(format("Name: %1% Weapon: %2%\nStrength: %3% Defense %4% ") %\r
spMonster->Name() % spMonster->WeaponName() % spMonster->Strength() %\r
return info;\r
}\r
\r
-string PlayerInfo(shared_ptr<PlayerGO> spPlayer)\r
+string PlayerInfo(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
string info = str(format("Name: %1% Level: %2%\nHealth: %3%/%4%") % \r
spPlayer->Name() % spPlayer->LevelNumber() % spPlayer->Health() %\r
return info;\r
}\r
\r
-void DisplayMonster(shared_ptr<MonsterGO> spMonster)\r
+void DisplayMonster(boost::shared_ptr<MonsterGO> spMonster)\r
{\r
cout << "Monster:\n" << MonsterInfo(spMonster) << endl;\r
}\r
\r
-void DisplayPlayer(shared_ptr<PlayerGO> spPlayer)\r
+void DisplayPlayer(boost::shared_ptr<PlayerGO> spPlayer)\r
{\r
cout << "Player:\n" << PlayerInfo(spPlayer) << endl;\r
}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectGuid>{9DAAD910-02AF-431F-88F2-08434ECB5102}</ProjectGuid>\r
+ <RootNamespace>testdriver</RootNamespace>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ <WholeProgramOptimization>true</WholeProgramOptimization>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>Application</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup>\r
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+ <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>\r
+ <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+ <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+ </PropertyGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <Optimization>Disabled</Optimization>\r
+ <AdditionalIncludeDirectories>$(SolutionDir)/libgameservgldl/include;$(SolutionDir)/libgameservcore/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+ <MinimalRebuild>true</MinimalRebuild>\r
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <Optimization>MaxSpeed</Optimization>\r
+ <IntrinsicFunctions>true</IntrinsicFunctions>\r
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>\r
+ <FunctionLevelLinking>true</FunctionLevelLinking>\r
+ <WarningLevel>Level3</WarningLevel>\r
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+ </ClCompile>\r
+ <Link>\r
+ <GenerateDebugInformation>true</GenerateDebugInformation>\r
+ <OptimizeReferences>true</OptimizeReferences>\r
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+ <TargetMachine>MachineX86</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="main.cpp" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ProjectReference Include="..\libgameservcore\libgameservcore.vcxproj">\r
+ <Project>{279aa91c-8638-45e5-aaa3-988f74764a97}</Project>\r
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+ </ProjectReference>\r
+ <ProjectReference Include="..\libgameservgldl\libgameservgldl.vcxproj">\r
+ <Project>{3ced9bd5-beaa-4c36-a735-aff2b3f2cf42}</Project>\r
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+ </ProjectReference>\r
+ </ItemGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>
\ No newline at end of file