Large overhaul of pointers to shared_ptrs, implemented function evaluation
This commit is contained in:
@@ -6,12 +6,13 @@
|
||||
#include "../EvaluationException.hpp"
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
|
||||
class EvalValue{
|
||||
public:
|
||||
EvalValue() = default;
|
||||
virtual ~EvalValue() = default;
|
||||
virtual ScriptType* GetType() = 0;
|
||||
virtual std::shared_ptr<ScriptType> GetType() = 0;
|
||||
|
||||
virtual bool operator ==(EvalValue* b) = 0;
|
||||
|
||||
@@ -37,22 +38,18 @@ public:
|
||||
|
||||
class BooleanEvalValue : public EvalValue{
|
||||
bool _value;
|
||||
ScriptType* _type;
|
||||
std::shared_ptr<ScriptType> _type;
|
||||
public:
|
||||
explicit BooleanEvalValue(bool val){
|
||||
_value = val;
|
||||
_type = new ScriptType(TypeClass::Bool);
|
||||
_type = std::make_shared<ScriptType>(TypeClass::Bool);
|
||||
}
|
||||
|
||||
EvalValue* Clone() final{
|
||||
return new BooleanEvalValue(_value);
|
||||
}
|
||||
|
||||
~BooleanEvalValue() final{
|
||||
delete _type;
|
||||
}
|
||||
|
||||
ScriptType* GetType() final{
|
||||
std::shared_ptr<ScriptType> GetType() final{
|
||||
return _type;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user