mirror of
https://github.com/DarkflameUniverse/DarkflameServer
synced 2024-08-30 18:43:58 +00:00
b432a3f5da
Clean up macros more tomorrow Cleanup and optimize CDActivities table Remove unused include Further work on CDActivityRewards Update MasterServer.cpp Further animations work Activities still needs work for a better PK. fix type All of these replacements worked Create internal interface for animations Allows for user to just call GetAnimationTIme or PlayAnimation rather than passing in arbitrary true false statements
42 lines
1009 B
C++
42 lines
1009 B
C++
#pragma once
|
|
|
|
#include "CDClientDatabase.h"
|
|
#include "Singleton.h"
|
|
#include "DluAssert.h"
|
|
|
|
#include <functional>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <map>
|
|
|
|
// CPPLinq
|
|
#ifdef _WIN32
|
|
#define NOMINMAX
|
|
// windows.h has min and max macros that breaks cpplinq
|
|
#endif
|
|
#include "cpplinq.hpp"
|
|
|
|
// Enable this to skip some unused columns in some tables
|
|
#define UNUSED_COLUMN(v)
|
|
|
|
#pragma warning (disable : 4244) //Disable double to float conversion warnings
|
|
#pragma warning (disable : 4715) //Disable "not all control paths return a value"
|
|
|
|
template<class Table>
|
|
class CDTable : public Singleton<Table> {
|
|
protected:
|
|
virtual ~CDTable() = default;
|
|
};
|
|
|
|
template<class T>
|
|
class LookupResult {
|
|
typedef std::pair<T, bool> DataType;
|
|
public:
|
|
LookupResult() { m_data.first = T(); m_data.second = false; };
|
|
LookupResult(T& data) { m_data.first = data; m_data.second = true; };
|
|
inline const T& Data() { return m_data.first; };
|
|
inline const bool& FoundData() { return m_data.second; };
|
|
private:
|
|
DataType m_data;
|
|
};
|