Used ClangFormat style guide I'm happy with.
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:
@@ -1,5 +1,3 @@
|
||||
|
||||
|
||||
#ifndef CREATURELIB_SCRIPTWRAPPER_HPP
|
||||
#define CREATURELIB_SCRIPTWRAPPER_HPP
|
||||
|
||||
@@ -7,27 +5,21 @@
|
||||
#include "Script.hpp"
|
||||
#include "ScriptSet.hpp"
|
||||
|
||||
namespace CreatureLib::Battling{
|
||||
namespace CreatureLib::Battling {
|
||||
class ScriptWrapper {
|
||||
std::variant<Script**, ScriptSet*> _value;
|
||||
bool _isSet;
|
||||
|
||||
public:
|
||||
ScriptWrapper(Script** s) : _value(s), _isSet(false){}
|
||||
ScriptWrapper(ScriptSet* s) : _value(s), _isSet(true){}
|
||||
ScriptWrapper(Script** s) : _value(s), _isSet(false) {}
|
||||
ScriptWrapper(ScriptSet* s) : _value(s), _isSet(true) {}
|
||||
|
||||
bool IsSet() const{
|
||||
return _isSet;
|
||||
}
|
||||
bool IsSet() const { return _isSet; }
|
||||
|
||||
Script** GetScript() const{
|
||||
return std::get<Script**>(_value);
|
||||
}
|
||||
Script** GetScript() const { return std::get<Script**>(_value); }
|
||||
|
||||
ScriptSet* GetScriptSet() const{
|
||||
return std::get<ScriptSet*>(_value);
|
||||
}
|
||||
ScriptSet* GetScriptSet() const { return std::get<ScriptSet*>(_value); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif //CREATURELIB_SCRIPTWRAPPER_HPP
|
||||
#endif // CREATURELIB_SCRIPTWRAPPER_HPP
|
||||
|
||||
Reference in New Issue
Block a user