OpenMoHAA ..
Loading...
Searching...
No Matches
nature.h
1/*
2===========================================================================
3Copyright (C) 2015 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23// nature.h:
24
25#pragma once
26
27#include "g_local.h"
28#include "trigger.h"
29
30class Emitter : public Entity
31{
32private:
33 str emitterName;
34 void setEmitter(str name);
35 void EmitterName(Event *ev);
36
37public:
38 CLASS_PROTOTYPE(Emitter);
39 Emitter();
40 void Archive(Archiver& arc) override;
41};
42
43inline void Emitter::Archive(Archiver& arc)
44{
45 Entity::Archive(arc);
46
47 arc.ArchiveString(&emitterName);
48 if (arc.Loading()) {
49 setEmitter(emitterName);
50 }
51}
52
53class Rain : public Emitter
54{
55private:
56 str rainName;
57 void setRainName(str name);
58
59public:
60 CLASS_PROTOTYPE(Rain);
61 Rain();
62 void Archive(Archiver& arc) override;
63};
64
65inline void Rain::Archive(Archiver& arc)
66{
67 Entity::Archive(arc);
68
69 arc.ArchiveString(&rainName);
70 if (arc.Loading()) {
71 setRainName(rainName);
72 }
73}
74
75class PuffDaddy : public Animate
76{
77private:
78 void Touch(Event *ev);
79 void Idle(Event *ev);
80
81public:
82 CLASS_PROTOTYPE(PuffDaddy);
83 PuffDaddy();
84};
Definition archive.h:86