mirror of
https://github.com/kevinbentley/Descent3.git
synced 2026-04-05 23:00:03 -04:00
clang-format on everything.
This commit is contained in:
@@ -10,75 +10,72 @@
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Turn off annoying warnings about truncated symbol names
|
||||
#pragma warning (disable:4786)
|
||||
#pragma warning(disable : 4786)
|
||||
#endif
|
||||
|
||||
#include <map>
|
||||
|
||||
BEGIN_AS_NAMESPACE
|
||||
|
||||
class CScriptDictionary
|
||||
{
|
||||
class CScriptDictionary {
|
||||
public:
|
||||
// Memory management
|
||||
CScriptDictionary(asIScriptEngine *engine);
|
||||
void AddRef();
|
||||
void Release();
|
||||
// Memory management
|
||||
CScriptDictionary(asIScriptEngine *engine);
|
||||
void AddRef();
|
||||
void Release();
|
||||
|
||||
// Sets/Gets a variable type value for a key
|
||||
void Set(const std::string &key, void *value, int typeId);
|
||||
bool Get(const std::string &key, void *value, int typeId) const;
|
||||
// Sets/Gets a variable type value for a key
|
||||
void Set(const std::string &key, void *value, int typeId);
|
||||
bool Get(const std::string &key, void *value, int typeId) const;
|
||||
|
||||
// Sets/Gets an integer number value for a key
|
||||
void Set(const std::string &key, asINT64 &value);
|
||||
bool Get(const std::string &key, asINT64 &value) const;
|
||||
// Sets/Gets an integer number value for a key
|
||||
void Set(const std::string &key, asINT64 &value);
|
||||
bool Get(const std::string &key, asINT64 &value) const;
|
||||
|
||||
// Sets/Gets a real number value for a key
|
||||
void Set(const std::string &key, double &value);
|
||||
bool Get(const std::string &key, double &value) const;
|
||||
// Sets/Gets a real number value for a key
|
||||
void Set(const std::string &key, double &value);
|
||||
bool Get(const std::string &key, double &value) const;
|
||||
|
||||
// Returns true if the key is set
|
||||
bool Exists(const std::string &key) const;
|
||||
// Returns true if the key is set
|
||||
bool Exists(const std::string &key) const;
|
||||
|
||||
// Deletes the key
|
||||
void Delete(const std::string &key);
|
||||
// Deletes the key
|
||||
void Delete(const std::string &key);
|
||||
|
||||
// Deletes all keys
|
||||
void DeleteAll();
|
||||
// Deletes all keys
|
||||
void DeleteAll();
|
||||
|
||||
// Garbage collections behaviours
|
||||
int GetRefCount();
|
||||
void SetGCFlag();
|
||||
bool GetGCFlag();
|
||||
void EnumReferences(asIScriptEngine *engine);
|
||||
void ReleaseAllReferences(asIScriptEngine *engine);
|
||||
// Garbage collections behaviours
|
||||
int GetRefCount();
|
||||
void SetGCFlag();
|
||||
bool GetGCFlag();
|
||||
void EnumReferences(asIScriptEngine *engine);
|
||||
void ReleaseAllReferences(asIScriptEngine *engine);
|
||||
|
||||
protected:
|
||||
// The structure for holding the values
|
||||
struct valueStruct
|
||||
{
|
||||
union
|
||||
{
|
||||
asINT64 valueInt;
|
||||
double valueFlt;
|
||||
void *valueObj;
|
||||
};
|
||||
int typeId;
|
||||
// The structure for holding the values
|
||||
struct valueStruct {
|
||||
union {
|
||||
asINT64 valueInt;
|
||||
double valueFlt;
|
||||
void *valueObj;
|
||||
};
|
||||
|
||||
// We don't want anyone to call the destructor directly, it should be called through the Release method
|
||||
virtual ~CScriptDictionary();
|
||||
int typeId;
|
||||
};
|
||||
|
||||
// Don't allow assignment
|
||||
CScriptDictionary &operator =(const CScriptDictionary &other);
|
||||
// We don't want anyone to call the destructor directly, it should be called through the Release method
|
||||
virtual ~CScriptDictionary();
|
||||
|
||||
// Helper methods
|
||||
void FreeValue(valueStruct &value);
|
||||
|
||||
// Our properties
|
||||
asIScriptEngine *engine;
|
||||
int refCount;
|
||||
std::map<std::string, valueStruct> dict;
|
||||
// Don't allow assignment
|
||||
CScriptDictionary &operator=(const CScriptDictionary &other);
|
||||
|
||||
// Helper methods
|
||||
void FreeValue(valueStruct &value);
|
||||
|
||||
// Our properties
|
||||
asIScriptEngine *engine;
|
||||
int refCount;
|
||||
std::map<std::string, valueStruct> dict;
|
||||
};
|
||||
|
||||
// This function will determine the configuration of the engine
|
||||
|
||||
Reference in New Issue
Block a user