Codechange: support strongly typed pool element IDs in squirrel/saveload
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#define SQUIRREL_HPP
|
||||
|
||||
#include <squirrel.h>
|
||||
#include "../core/convertible_through_base.hpp"
|
||||
|
||||
/** The type of script we're working with, i.e. for who is it? */
|
||||
enum class ScriptType : uint8_t {
|
||||
@@ -110,6 +111,8 @@ public:
|
||||
*/
|
||||
void AddConst(const char *var_name, uint value) { this->AddConst(var_name, (int)value); }
|
||||
|
||||
void AddConst(const char *var_name, const ConvertibleThroughBase auto &value) { this->AddConst(var_name, static_cast<int>(value.base())); }
|
||||
|
||||
/**
|
||||
* Adds a const to the stack. Depending on the current state this means
|
||||
* either a const to a class or to the global space.
|
||||
@@ -152,6 +155,7 @@ public:
|
||||
void InsertResult(bool result);
|
||||
void InsertResult(int result);
|
||||
void InsertResult(uint result) { this->InsertResult((int)result); }
|
||||
void InsertResult(ConvertibleThroughBase auto result) { this->InsertResult(static_cast<int>(result.base())); }
|
||||
|
||||
/**
|
||||
* Call a method of an instance, in various flavors.
|
||||
|
||||
Reference in New Issue
Block a user