OpenClonk
C4Action.cpp
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2013-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* The C4Action class is merely a simple data structure */
19 
20 #include "C4Include.h"
21 #include "object/C4Object.h"
22 
24 {
25  Default();
26 }
27 
28 C4Action::~C4Action() = default;
29 
31 {
32  Dir = DIR_None;
33  DrawDir = Dir;
34  ComDir = COMD_Stop;
35  Time = 0;
36  Data = 0;
37  Target = nullptr;
38  Target2 = nullptr;
39  Phase = 0;
40  PhaseDelay = 0;
41  Facet.Default();
42  FacetX = 0;
43  FacetY = 0;
45  Animation = nullptr;
46 }
47 
49 {
50  // Note: Compiled directly into "Object"-categories, so beware of name clashes (see C4Object::CompileFunc)
51  comp->Value(mkNamingAdapt( Dir, "Dir", DIR_None ));
52  comp->Value(mkNamingAdapt( ComDir, "ComDir", COMD_Stop ));
53  comp->Value(mkNamingAdapt( Time, "ActionTime", 0 ));
54  comp->Value(mkNamingAdapt( Data, "ActionData", 0 ));
55  comp->Value(mkNamingAdapt( Phase, "Phase", 0 ));
56  comp->Value(mkNamingAdapt( PhaseDelay, "PhaseDelay", 0 ));
57 }
const BYTE CNAT_None
Definition: C4Constants.h:108
#define DIR_None
Definition: C4Object.h:40
#define COMD_Stop
Definition: C4Object.h:50
StdNamingAdapt< T > mkNamingAdapt(T &&rValue, const char *szName)
Definition: StdAdaptors.h:92
C4Action()
Definition: C4Action.cpp:23
C4Facet Facet
Definition: C4Object.h:88
int32_t Data
Definition: C4Object.h:84
int32_t t_attach
Definition: C4Object.h:86
void CompileFunc(StdCompiler *pComp)
Definition: C4Action.cpp:48
int32_t Time
Definition: C4Object.h:83
int32_t PhaseDelay
Definition: C4Object.h:85
int32_t Phase
Definition: C4Object.h:85
void Default()
Definition: C4Action.cpp:30
C4ObjectPtr Target2
Definition: C4Object.h:87
int32_t ComDir
Definition: C4Object.h:82
int32_t Dir
Definition: C4Object.h:80
int32_t FacetY
Definition: C4Object.h:89
int32_t DrawDir
Definition: C4Object.h:81
int32_t FacetX
Definition: C4Object.h:89
StdMeshInstanceAnimationNode * Animation
Definition: C4Object.h:90
C4ObjectPtr Target
Definition: C4Object.h:87
void Default()
Definition: C4Facet.cpp:31
void Value(const T &rStruct)
Definition: StdCompiler.h:161