Greatly simplify handling numerical eval values, using std::variant
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Porygon::UserData{
|
||||
}
|
||||
|
||||
const Evaluation::EvalValue* GetCurrent() final{
|
||||
return new Evaluation::IntegerEvalValue(_current);
|
||||
return new Evaluation::NumericEvalValue(static_cast<int64_t>(_current));
|
||||
}
|
||||
bool MoveNext() final{
|
||||
_current ++;
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
|
||||
#define PORYGON_INTEGER_FIELD(fieldName) \
|
||||
PORYGON_FIELD(fieldName, PORYGON_INTEGER_TYPE, \
|
||||
const Porygon::Evaluation::IntegerEvalValue(((T_USERDATA*)obj)->fieldName), val->EvaluateInteger())
|
||||
const Porygon::Evaluation::NumericEvalValue(((T_USERDATA*)obj)->fieldName), val->EvaluateInteger())
|
||||
|
||||
#define PORYGON_READONLY_INTEGER_FIELD(fieldName) \
|
||||
PORYGON_READONLY_FIELD(fieldName, PORYGON_INTEGER_TYPE, \
|
||||
Porygon::Evaluation::IntegerEvalValue(((T_USERDATA*)obj)->fieldName))
|
||||
Porygon::Evaluation::NumericEvalValue(((T_USERDATA*)obj)->fieldName))
|
||||
|
||||
#define PORYGON_FLOAT_FIELD(fieldName) \
|
||||
PORYGON_FIELD(fieldName, PORYGON_FLOAT_TYPE, \
|
||||
|
||||
Reference in New Issue
Block a user