-
Notifications
You must be signed in to change notification settings - Fork 0
/
OnOffApplication.h
85 lines (70 loc) · 2.42 KB
/
OnOffApplication.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef OnOffApplication_H
#define OnOffApplication_H
#include <Urho3D/Engine/Application.h>
namespace Urho3D
{
class Context;
class ScriptFile;
}
namespace OnOff
{
URHO3D_EVENT(E_LEVELCOMPLETE, LevelComplete)
{
URHO3D_PARAM(P_NEXTLEVEL, NextLevel); // Urho3D::String
URHO3D_PARAM(P_NEXTLEVELTITLE, NextLevelTitle);// Urho3D::String
URHO3D_PARAM(P_DISPLAYMESSAGE, DisplayMessage);// boolean
}
URHO3D_EVENT(E_LEVELRESTART, LevelRestart)
{
URHO3D_PARAM(P_MESSAGE, Message); // Urho3D::String
URHO3D_PARAM(P_TYPE, Type); // Urho3D::String
URHO3D_PARAM(P_DISPLAYMESSAGE, DisplayMessage);// boolean
}
URHO3D_EVENT(E_PLAYERDEATH, PlayerDeath)
{
URHO3D_PARAM(P_MESSAGE, Message); // Urho3D::String
URHO3D_PARAM(P_TYPE, Type); // Urho3D::String
URHO3D_PARAM(P_DISPLAYMESSAGE, DisplayMessage);// boolean
}
URHO3D_EVENT(E_POWERACTIVATED, PowerActivated)
{
URHO3D_PARAM(P_POWER, Power); // float
}
URHO3D_EVENT(E_POWERDEACTIVATED, PowerDeactivated)
{
URHO3D_PARAM(P_POWER, Power); // float
}
URHO3D_EVENT(E_PICKUP, Pickup)
{
URHO3D_PARAM(P_PICKUPNODE, PickupNode); // Urho3D::Node
URHO3D_PARAM(P_PICKUPERNODE, PickuperNode); // Urho3D::Node
URHO3D_PARAM(P_TYPE, Type); // Urho3D::String
URHO3D_PARAM(P_POWER, Power); // float
}
URHO3D_EVENT(E_SHOWDIALOG, ShowDialog)
{
URHO3D_PARAM(P_DIALOG, Dialog); // Urho3D::String
URHO3D_PARAM(P_TITLE, Title); // Urho3D::String
URHO3D_PARAM(P_MESSAGE, Message); // Urho3D::String
URHO3D_PARAM(P_IMAGE, Image); // Urho3D::String
URHO3D_PARAM(P_IMAGERECT, ImageRect); // Urho3D::IntRect
}
class OnOffApplication : public Urho3D::Application
{
URHO3D_OBJECT(OnOffApplication, Urho3D::Application);
public:
OnOffApplication(Urho3D::Context* context);
virtual ~OnOffApplication() {}
protected:
virtual void Setup();
virtual void Start();
virtual void Stop();
private:
void HandleScriptReloadStarted(Urho3D::StringHash type, Urho3D::VariantMap& data);
void HandleScriptReloadFailed(Urho3D::StringHash type, Urho3D::VariantMap& data);
void HandleScriptReloadFinished(Urho3D::StringHash type, Urho3D::VariantMap& data);
Urho3D::Context* context_;
Urho3D::SharedPtr<Urho3D::ScriptFile> script_;
};
}
#endif //OnOffApplication_H