Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-11-09 20:15:06 +0000
committerStijn Buys <ingar@osirion.org>2013-11-09 20:15:06 +0000
commit2218c7094ad6dc40b200274ebffdc9fb4c1a8e0c (patch)
tree97a89e9ae8b5302ffeb80cad85b9e95daf51f019 /src/game/base/npctype.h
parente69ce33b0436d0fa9b81e032442026a43cbbbb05 (diff)
Removed shipmodel npcname support,
made Patrols load NPC types instead of ship models, replaces patrol [ship] subsection with a [npc] subsection.
Diffstat (limited to 'src/game/base/npctype.h')
-rw-r--r--src/game/base/npctype.h122
1 files changed, 122 insertions, 0 deletions
diff --git a/src/game/base/npctype.h b/src/game/base/npctype.h
new file mode 100644
index 0000000..fd9515f
--- /dev/null
+++ b/src/game/base/npctype.h
@@ -0,0 +1,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__