value property

int? value

Gets a read of the rawValue. If the type is VARIABLE, then performs an implicit read of the variable's address, otherwise just returns the rawValue (SMALL or LARGE);

Implementation

int? get value{
  switch(oType){
    case OperandType.large:
    case OperandType.small:
      return rawValue;
    case OperandType.variable:
      //prevents popping the stack more than once for
      //value inspection.
      _cachedValue ??= Z.engine.readVariable(rawValue!);
      return _cachedValue;
    default:
      throw GameException('Invalid Operand Type: $oType');
  }
}