OpenMW
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
components
interpreter
scriptopcodes.hpp
Go to the documentation of this file.
1
#ifndef INTERPRETER_SCRIPTOPCODES_H_INCLUDED
2
#define INTERPRETER_SCRIPTOPCODES_H_INCLUDED
3
4
#include "
opcodes.hpp
"
5
#include "
runtime.hpp
"
6
#include "
context.hpp
"
7
8
namespace
Interpreter
9
{
10
class
OpScriptRunning
:
public
Opcode0
11
{
12
public
:
13
14
virtual
void
execute
(
Runtime
& runtime)
15
{
16
std::string
name
= runtime.
getStringLiteral
(runtime[0].mInteger);
17
runtime[0].mInteger = runtime.
getContext
().
isScriptRunning
(name);
18
}
19
};
20
21
class
OpStartScript
:
public
Opcode0
22
{
23
public
:
24
25
virtual
void
execute
(
Runtime
& runtime)
26
{
27
std::string
name
= runtime.
getStringLiteral
(runtime[0].mInteger);
28
runtime.
pop
();
29
runtime.
getContext
().
startScript
(name, runtime.
getContext
().
getTargetId
());
30
}
31
};
32
33
class
OpStartScriptExplicit
:
public
Opcode0
34
{
35
public
:
36
37
virtual
void
execute
(
Runtime
& runtime)
38
{
39
std::string targetId = runtime.
getStringLiteral
(runtime[0].mInteger);
40
runtime.
pop
();
41
42
std::string
name
= runtime.
getStringLiteral
(runtime[0].mInteger);
43
runtime.
pop
();
44
45
runtime.
getContext
().
startScript
(name, targetId);
46
}
47
};
48
49
class
OpStopScript
:
public
Opcode0
50
{
51
public
:
52
53
virtual
void
execute
(
Runtime
& runtime)
54
{
55
std::string
name
= runtime.
getStringLiteral
(runtime[0].mInteger);
56
runtime.
pop
();
57
runtime.
getContext
().
stopScript
(name);
58
}
59
};
60
}
61
62
#endif
63
Interpreter::Context::getTargetId
virtual std::string getTargetId() const =0
Interpreter::OpStartScript
Definition:
scriptopcodes.hpp:21
Interpreter::OpScriptRunning
Definition:
scriptopcodes.hpp:10
Interpreter::Runtime::pop
void pop()
pop stack
Definition:
runtime.cpp:94
Interpreter::OpStartScriptExplicit::execute
virtual void execute(Runtime &runtime)
Definition:
scriptopcodes.hpp:37
Interpreter::Runtime::getStringLiteral
std::string getStringLiteral(int index) const
Definition:
runtime.cpp:34
Interpreter::Runtime
Runtime data and engine interface.
Definition:
runtime.hpp:15
Interpreter::Opcode0
opcode for 0 arguments
Definition:
opcodes.hpp:9
Interpreter::OpStopScript::execute
virtual void execute(Runtime &runtime)
Definition:
scriptopcodes.hpp:53
Interpreter::OpStopScript
Definition:
scriptopcodes.hpp:49
opcodes.hpp
runtime.hpp
Interpreter::OpScriptRunning::execute
virtual void execute(Runtime &runtime)
Definition:
scriptopcodes.hpp:14
Interpreter::Context::startScript
virtual void startScript(const std::string &name, const std::string &targetId="")=0
Interpreter::OpStartScript::execute
virtual void execute(Runtime &runtime)
Definition:
scriptopcodes.hpp:25
context.hpp
Interpreter::Runtime::getContext
Context & getContext()
Definition:
runtime.cpp:110
Interpreter::OpStartScriptExplicit
Definition:
scriptopcodes.hpp:33
Interpreter::Context::stopScript
virtual void stopScript(const std::string &name)=0
Interpreter::Context::isScriptRunning
virtual bool isScriptRunning(const std::string &name) const =0
name
const char * name
Definition:
crashcatcher.cpp:59
Generated on Tue Jan 24 2017 02:05:52 for OpenMW by
1.8.6