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
spatialopcodes.hpp
Go to the documentation of this file.
1
#ifndef INTERPRETER_SPATIALOPCODES_H_INCLUDED
2
#define INTERPRETER_SPATIALOPCODES_H_INCLUDED
3
4
#include "
opcodes.hpp
"
5
#include "
runtime.hpp
"
6
7
namespace
Interpreter
8
{
9
class
OpGetDistance
:
public
Opcode0
10
{
11
public
:
12
13
virtual
void
execute
(
Runtime
& runtime)
14
{
15
std::string
name
= runtime.
getStringLiteral
(runtime[0].mInteger);
16
17
Type_Float
distance
= runtime.
getContext
().
getDistance
(name);
18
19
runtime[0].mFloat =
distance
;
20
}
21
};
22
23
class
OpGetDistanceExplicit
:
public
Opcode0
24
{
25
public
:
26
27
virtual
void
execute
(
Runtime
& runtime)
28
{
29
int
index = runtime[0].mInteger;
30
runtime.
pop
();
31
std::string
id
= runtime.
getStringLiteral
(index);
32
33
std::string
name
= runtime.
getStringLiteral
(runtime[0].mInteger);
34
35
Type_Float
distance
= runtime.
getContext
().
getDistance
(name,
id
);
36
37
runtime[0].mFloat =
distance
;
38
}
39
};
40
}
41
42
#endif
43
Interpreter::Runtime::pop
void pop()
pop stack
Definition:
runtime.cpp:94
Interpreter::Runtime::getStringLiteral
std::string getStringLiteral(int index) const
Definition:
runtime.cpp:34
Interpreter::Context::getDistance
virtual float getDistance(const std::string &name, const std::string &id="") const =0
Interpreter::Runtime
Runtime data and engine interface.
Definition:
runtime.hpp:15
Interpreter::Opcode0
opcode for 0 arguments
Definition:
opcodes.hpp:9
opcodes.hpp
Interpreter::OpGetDistance
Definition:
spatialopcodes.hpp:9
runtime.hpp
Interpreter::OpGetDistanceExplicit
Definition:
spatialopcodes.hpp:23
MWMechanics::distance
float distance(const ESM::Pathgrid::Point &point, float x, float y, float z)
Definition:
pathfinding.cpp:69
Interpreter::Runtime::getContext
Context & getContext()
Definition:
runtime.cpp:110
Interpreter::Type_Float
float Type_Float
Definition:
types.hpp:16
Interpreter::OpGetDistance::execute
virtual void execute(Runtime &runtime)
Definition:
spatialopcodes.hpp:13
Interpreter::OpGetDistanceExplicit::execute
virtual void execute(Runtime &runtime)
Definition:
spatialopcodes.hpp:27
name
const char * name
Definition:
crashcatcher.cpp:59
Generated on Tue Jan 24 2017 02:05:52 for OpenMW by
1.8.6