Add todo for GetArray subscript operator
This commit is contained in:
parent
f03f7bdacc
commit
75eecf7da3
|
@ -3293,6 +3293,11 @@ float ProgramValue::asFloat() const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ProgramValue::isString() const
|
||||||
|
{
|
||||||
|
return opcode == VALUE_TYPE_STRING || opcode == VALUE_TYPE_DYNAMIC_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
ProgramValue::ProgramValue()
|
ProgramValue::ProgramValue()
|
||||||
{
|
{
|
||||||
opcode = VALUE_TYPE_INT;
|
opcode = VALUE_TYPE_INT;
|
||||||
|
|
|
@ -157,6 +157,7 @@ public:
|
||||||
bool isEmpty() const;
|
bool isEmpty() const;
|
||||||
bool isInt() const;
|
bool isInt() const;
|
||||||
bool isFloat() const;
|
bool isFloat() const;
|
||||||
|
bool isString() const;
|
||||||
float asFloat() const;
|
float asFloat() const;
|
||||||
bool isPointer() const;
|
bool isPointer() const;
|
||||||
int asInt() const;
|
int asInt() const;
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "svga.h"
|
#include "svga.h"
|
||||||
#include "tile.h"
|
#include "tile.h"
|
||||||
#include "worldmap.h"
|
#include "worldmap.h"
|
||||||
|
#include <stdexcept>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
namespace fallout {
|
namespace fallout {
|
||||||
|
@ -543,7 +544,8 @@ static void opGetArray(Program* program)
|
||||||
if (arrayId.isInt()) {
|
if (arrayId.isInt()) {
|
||||||
auto value = GetArray(arrayId.integerValue, key);
|
auto value = GetArray(arrayId.integerValue, key);
|
||||||
programStackPushValue(program, value);
|
programStackPushValue(program, value);
|
||||||
} else {
|
} else if (arrayId.isString()) {
|
||||||
|
throw std::invalid_argument("String subscript is not implemented yet!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue