20 #include "../bscript/berror.h" 21 #include "../bscript/bobject.h" 22 #include "../bscript/dict.h" 23 #include "../bscript/executor.h" 24 #include "../bscript/impstr.h" 25 #include "../bscript/objmembers.h" 26 #include "../bscript/objmethods.h" 27 #include "../clib/strutil.h" 28 #include "../plib/systemstate.h" 39 using namespace Bscript;
59 if (
value().exists() )
62 return new BError(
"Script has been destroyed" );
68 if ( !
value().exists() )
69 return new BError(
"Script has been destroyed" );
79 return new BError(
"Not enough parameters" );
91 std::string message = std::string(
"Member " ) + std::string( mname->
value() ) +
92 std::string(
" not found on that object" );
93 return new BError( message );
101 return new BError(
"Invalid parameter type" );
107 return new BError(
"Not enough parameters" );
110 return new BLong( 1 );
112 return new BError(
"Event queue is full, discarding event" );
123 return new BLong( 1 );
128 return new BLong( !res );
135 return new BError(
"undefined" );
142 if ( objmethod !=
nullptr )
145 return new BError(
"undefined" );
152 BObjectRefVec::const_iterator itr = uoexec->
Globals2.begin(), end = uoexec->
Globals2.end();
154 for (
unsigned idx = 0; itr != end; ++itr, ++idx )
156 const BObjectRef obref( ( *itr )->impref().copy() );
168 if ( !
value().exists() )
229 if ( objmember !=
nullptr )
const EScriptProgram * prog() const
const std::string & value() const
bool in_debugger_holdlist() const
virtual u8 typeOfInt() const POL_OVERRIDE
bool isa(BObjectType type) const
virtual Bscript::BObjectRef get_member_id(const int id) POL_OVERRIDE
unsigned int runaway_script_threshold
ObjMember * getKnownObjMember(const char *token)
std::string decint(unsigned short v)
bool signal_event(Bscript::BObjectImp *eventimp)
virtual Bscript::BObjectImp * call_method_id(const int id, Bscript::Executor &ex, bool forcebuiltin=false) POL_OVERRIDE
virtual Bscript::BObjectImp * call_method(const char *methodname, Bscript::Executor &ex) POL_OVERRIDE
virtual const char * typeOf() const POL_OVERRIDE
virtual BObjectImp * copy() const =0
Core::CharacterRef controller_
ObjMethod * getKnownObjMethod(const char *token)
BObjectImp * GetGlobals(const UOExecutor *uoexec)
std::vector< std::string > globalvarnames
std::vector< ReturnContext > ControlStack
Mobile::Character * attached_chr_
ExecutorModule * findModule(const std::string &name)
virtual size_t sizeEstimate() const POL_OVERRIDE
u64 warn_runaway_on_cycle
virtual Bscript::BObjectRef get_member(const char *membername) POL_OVERRIDE
static UninitObject * create()
Items::Item * attached_item_
void addMember(const char *name, BObjectRef val)
const std::string & scriptname() const
const String * getStringParam(unsigned param)
bool hasParams(unsigned howmany) const
BApplicObjType scriptexobjimp_type
Bscript::BObjectImp * clear_event_queue()
virtual Bscript::BObjectImp * copy() const POL_OVERRIDE
Mobile::Character * attached_npc_
BObjectImp * getParamImp(unsigned param)
Module::OSExecutorModule * os_module
ScriptExObjImp(UOExecutor *uoexec)