resonance 1.0.1
Loading...
Searching...
No Matches
scriptmsg.h
Go to the documentation of this file.
1#pragma once
2
3#include "msg/message.h"
4#include "os/hxstr.h"
5
18class ScriptMsg : public Message {
19public:
21 ScriptMsg() = default;
22
30 explicit ScriptMsg(const HxStr &script) : mScript(script) {
31 }
32
42 static Message *New();
43
51 virtual Message *Clone();
52
60 virtual int Type();
61
69 virtual const char *GetName() const;
70
79};
80
89extern int g_nScriptMsgType;
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Base of every event the game passes between a MsgSource and a MsgSink.
Definition message.h:41
virtual const char * GetName() const
Report this message's class name.
static Message * New()
Produce a message with an empty script on the heap.
HxStr mScript
Script text to run.
Definition scriptmsg.h:78
ScriptMsg(const HxStr &script)
Wrap a line of script text.
Definition scriptmsg.h:30
virtual Message * Clone()
Produce a heap copy of this message.
virtual int Type()
Report this message's registered identity.
ScriptMsg()=default
Wrap an empty script.
int g_nScriptMsgType
Identity that ScriptSink compares a message against before running its text.