1 #ifndef INTERPRETER_MISCOPCODES_H_INCLUDED
2 #define INTERPRETER_MISCOPCODES_H_INCLUDED
29 std::ostringstream out;
34 out.precision(precision);
61 out << std::fixed << value;
84 MessageFormatParser::process(message);
100 return formattedMessage;
110 int index = runtime[0].mInteger;
115 std::vector<std::string> buttons;
117 for (std::size_t i=0; i<arg0; ++i)
119 index = runtime[0].mInteger;
124 std::reverse (buttons.begin(), buttons.end());
127 std::string formattedMessage =
formatMessage (message, runtime);
140 int index = runtime[0].mInteger;
145 std::string formattedMessage =
formatMessage (message, runtime);
170 throw std::runtime_error (
171 "random: argument out of range (Don't be so negative!)");
175 runtime[0].mInteger = value;
187 runtime.
push (duration);
227 int index = runtime[0].mInteger;
241 int index = runtime[0].mInteger;
255 int index = runtime[0].mInteger;
virtual void enable(const std::string &id="")=0
std::string formatMessage(const std::string &message, Runtime &runtime)
Definition: miscopcodes.hpp:93
void message(CodeContainer &code, Literals &literals, const std::string &message, int buttons)
Definition: generator.cpp:537
void pop()
pop stack
Definition: runtime.cpp:94
void push(const Data &data)
push data on stack
Definition: runtime.cpp:75
std::string getStringLiteral(int index) const
Definition: runtime.cpp:34
Runtime data and engine interface.
Definition: runtime.hpp:15
Definition: miscopcodes.hpp:235
opcode for 0 arguments
Definition: opcodes.hpp:9
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:239
Definition: miscopcodes.hpp:191
virtual bool isDisabled(const std::string &id="") const =0
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:195
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:183
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:253
Definition: miscopcodes.hpp:133
static int rollDice(int max)
return value in range [0, max) <- note open upper range.
Definition: rng.cpp:23
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:205
Definition: miscopcodes.hpp:161
Definition: miscopcodes.hpp:249
Definition: miscopcodes.hpp:179
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:225
virtual void messageBox(const std::string &message, const std::vector< std::string > &buttons)=0
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:137
virtual void execute(Runtime &runtime, unsigned int arg0)
Definition: miscopcodes.hpp:107
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:165
Context & getContext()
Definition: runtime.cpp:110
virtual float getSecondsPassed() const =0
float Type_Float
Definition: types.hpp:16
std::string fixDefinesMsgBox(const std::string &text, Context &context)
Definition: defines.cpp:215
Definition: miscopcodes.hpp:201
opcode for 1 argument
Definition: opcodes.hpp:19
virtual void execute(Runtime &runtime)
Definition: miscopcodes.hpp:215
Definition: miscopcodes.hpp:211
virtual void disable(const std::string &id="")=0
Definition: miscopcodes.hpp:221
virtual bool menuMode()=0
virtual void report(const std::string &message)=0
Definition: miscopcodes.hpp:103