forked from Warzone2100/warzone2100
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeaturedef.h
77 lines (62 loc) · 2.4 KB
/
featuredef.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
/*
This file is part of Warzone 2100.
Copyright (C) 1999-2004 Eidos Interactive
Copyright (C) 2005-2019 Warzone 2100 Project
Warzone 2100 is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Warzone 2100 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Warzone 2100; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** \file
* Definitions for features.
*/
#ifndef __INCLUDED_FEATUREDEF_H__
#define __INCLUDED_FEATUREDEF_H__
#include "basedef.h"
#include "statsdef.h"
enum FEATURE_TYPE
{
FEAT_TANK = 2, // hack to keep enums the same value
FEAT_GEN_ARTE,
FEAT_OIL_RESOURCE,
FEAT_BOULDER,
FEAT_VEHICLE,
FEAT_BUILDING,
FEAT_UNUSED,
FEAT_LOS_OBJ,
FEAT_OIL_DRUM,
FEAT_TREE,
FEAT_SKYSCRAPER,
FEAT_COUNT
};
/* Stats for a feature */
struct FEATURE_STATS : public BASE_STATS
{
FEATURE_STATS(int idx = 0) : BASE_STATS(idx) {}
FEATURE_TYPE subType = FEAT_COUNT; ///< type of feature
iIMDShape *psImd = nullptr; ///< Graphic for the feature
UWORD baseWidth = 0; ///< The width of the base in tiles
UWORD baseBreadth = 0; ///< The breadth of the base in tiles
bool tileDraw = false; ///< Whether the tile needs to be drawn
bool allowLOS = false; ///< Whether the feature allows the LOS. true = can see through the feature
bool visibleAtStart = false; ///< Whether the feature is visible at the start of the mission
bool damageable = false; ///< Whether the feature can be destroyed
UDWORD body = 0; ///< Number of body points
UDWORD armourValue = 0; ///< Feature armour
inline Vector2i size() const { return Vector2i(baseWidth, baseBreadth); }
};
struct FEATURE : public BASE_OBJECT
{
FEATURE(uint32_t id, FEATURE_STATS const *psStats);
~FEATURE();
FEATURE_STATS const *psStats;
inline Vector2i size() const { return psStats->size(); }
};
#endif // __INCLUDED_FEATUREDEF_H__