Use array class

This commit is contained in:
Federico Cecchetto
2021-06-18 22:42:12 +02:00
parent 7170f863f3
commit c8063eb0b0
10 changed files with 364 additions and 84 deletions

View File

@ -1,7 +1,7 @@
#include <stdinc.hpp>
#include "script_value.hpp"
#include "entity.hpp"
#include "array.hpp"
namespace scripting
{
@ -219,7 +219,7 @@ namespace scripting
**************************************************************/
template <>
bool script_value::is<std::vector<script_value>>() const
bool script_value::is<array>() const
{
if (this->get_raw().type != game::SCRIPT_OBJECT)
{
@ -232,6 +232,12 @@ namespace scripting
return type == game::SCRIPT_ARRAY;
}
template <>
array script_value::get() const
{
return array(this->get_raw().u.uintValue);
}
/***************************************************************
* Struct
**************************************************************/