OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
crateobject.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// crateobject.h : Crates
24
25#pragma once
26
27#include "entity.h"
28
29#define CRATE_INDESTRUCTABLE 1
30#define CRATE_NOTSTACKEDON 2
31
32class CrateObject : public Entity
33{
34 float m_fMoveTime;
35 int m_iDebrisType;
36 Vector m_vJitterAngles;
37 Vector m_vStartAngles;
38 float m_fJitterScale;
39
40private:
41 void TellNeighborsToFall(void);
42 void TellNeighborsToJitter(Vector vJitterAdd);
43
44public:
45 CLASS_PROTOTYPE(CrateObject);
46
47 CrateObject();
48
49 void CrateSetup(Event *ev);
50 void CrateDebrisType(Event *ev);
51 void StartFalling(Event *ev);
52 void CrateFalling(Event *ev);
53 void CrateDamaged(Event *ev);
54 void CrateKilled(Event *ev);
55 void CrateThink(Event *ev);
56 void Archive(Archiver& arc) override;
57};
58
59inline void CrateObject::Archive(Archiver& arc)
60{
61 Entity::Archive(arc);
62
63 arc.ArchiveFloat(&m_fMoveTime);
64 arc.ArchiveInteger(&m_iDebrisType);
65
66 arc.ArchiveVector(&m_vJitterAngles);
67 arc.ArchiveVector(&m_vStartAngles);
68 arc.ArchiveFloat(&m_fJitterScale);
69}
70
Definition archive.h:86
Definition listener.h:246
Definition vector.h:61