blob: fd9515f6aca98accdd3ba43dbdc4d63974fc5ab7 (
plain)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
/*
base/npctype.h
This file is part of the Osirion project and is distributed under
the terms and conditions of the GNU General Public License version 2
*/
#ifndef __INCLUDED_BASE_NPCTYPE_H__
#define __INCLUDED_BASE_NPCTYPE_H__
#include "base/faction.h"
#include "base/shipmodel.h"
#include "base/weapon.h"
namespace game
{
/**
* @brief NPC generation information
* Used by Patrols to generate NPC instances
* */
class NPCType {
public:
/**
* @brief constructor
* */
NPCType();
/**
* @brief destructor
* */
~NPCType();
/* --- inspectors ------------------------------------------ */
/**
* @brief entity name to be used by the NPC
* */
inline const std::string &name() const
{
return npctype_name;
}
/**
* @brief the maximal amount of NPCs of this type to generate
* */
inline const long amount() const
{
return npctype_amount;
}
/**
* @brief true if the NPC will buy cargo
* */
inline const bool is_merchant() const
{
return npctype_merchant;
}
/**
* @brief the faction the NPC will belong to
* */
inline const Faction *faction() const
{
return npctype_faction;
}
/**
* @brief the shipmodel the NPC will use
* */
inline const ShipModel *shipmodel() const
{
return npctype_shipmodel;
}
/**
* @brief the type of cannons the NPC will use
* */
inline const Weapon *cannon() const
{
return npctype_cannon;
}
/**
* @brief the type of turrets the NPC will use
* */
inline const Weapon *turret() const
{
return npctype_turret;
}
/* --- mutators -------------------------------------------- */
void set_name(const std::string &name);
void set_amount(const long amount);
void set_merchant(const bool is_merchant = false);
void set_faction(const Faction *faction);
void set_shipmodel(const ShipModel *shipmodel);
void set_cannon(const Weapon *cannon);
void set_turret(const Weapon *turret);
private:
std::string npctype_name;
long npctype_amount;
bool npctype_merchant;
const Faction *npctype_faction;
const ShipModel *npctype_shipmodel;
const Weapon *npctype_cannon;
const Weapon *npctype_turret;
};
} // namespace game
#endif // __INCLUDED_BASE_NPCTYPE_H__
|