Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-11-28 12:55:22 +01:00
parent 3b685ae782
commit a8730d983f
91 changed files with 946 additions and 1121 deletions

View File

@@ -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