Files
iw5-gsc-utils/src/game/scripting/function.hpp
Federico Cecchetto 97371d8f44 Use function class
2021-06-19 22:17:41 +02:00

35 lines
671 B
C++

#pragma once
#include "entity.hpp"
#include "script_value.hpp"
namespace scripting
{
class function
{
public:
function(const char*);
script_value get_raw() const;
const char* get_pos() const;
script_value call(entity self, std::vector<script_value> arguments) const;
script_value operator()(entity self, std::vector<script_value> arguments) const
{
return this->call(self, arguments);
}
script_value operator()(std::vector<script_value> arguments) const
{
return this->call(*game::levelEntityId, arguments);
}
script_value operator()() const
{
return this->call(*game::levelEntityId, {});
}
private:
const char* pos_;
};
}