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-10-13 18:57:40 +0000
committerStijn Buys <ingar@osirion.org>2013-10-13 18:57:40 +0000
commit22efe13cd7a489c13e91f166cff80cbae350785b (patch)
tree0d73baacce33d7d5475c32add60d8d05a7c05b98 /src/game/base/npc.h
parent6e140025aab2c57b400c54a06b811875c196cede (diff)
Added the actual NPC class files.
Diffstat (limited to 'src/game/base/npc.h')
-rw-r--r--src/game/base/npc.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/src/game/base/npc.h b/src/game/base/npc.h
new file mode 100644
index 0000000..4a89529
--- /dev/null
+++ b/src/game/base/npc.h
@@ -0,0 +1,102 @@
+/*
+ base/npc.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_NPC_H__
+#define __INCLUDED_BASE_NPC_H__
+
+#include "base/ship.h"
+
+namespace game
+{
+
+class NPC : public Ship {
+
+public:
+ /**
+ * @brief Definse the general profile of the NPC
+ * The NPC profile is set at creating time and can not be altered.
+ *
+ * Freelancer fallback value
+ * Trader Trade convoy member, prefers trade routes
+ * Military Police or military, prefers patrol routes
+ * Wingman wingman, prefers protecting its leader
+ * */
+ enum Profile { ProfileFreelancer = 0, ProfileTrader = 1, ProfileMilitary = 2, ProfilePirate = 3, ProfileWingman = 4 };
+
+ /**
+ * @brief Defines the general moode of the NPC
+ * Wander Wamder around
+ * Formation Follow the leader in formation
+ * */
+ enum Mood { MoodWander = 0, MoodFormation = 1 };
+
+ NPC(const Profile profile, const ShipModel *shipmodel);
+
+ /* ---- inspectors ----------------------------------------- */
+
+ /**
+ * @brief Treturns te general profile of the NPC
+ * The NPC profile is set at creating time and can not be altered.
+ * */
+ inline const Profile profile() const
+ {
+ return npc_profile;
+ }
+
+ /**
+ * @brief returns the general moode of the NPC
+ * */
+ inline const Mood mood() const
+ {
+ return npc_mood;
+ }
+
+ /**
+ * @brief returns this NPC's leader.
+ * */
+ inline Ship *leader()
+ {
+ return npc_leader;
+ }
+
+ /* ---- mutators ------------------------------------------- */
+
+ /**
+ * @brief Set the general moode of the NPC
+ * */
+ void set_mood(const Mood mood);
+
+ /**
+ * @brief set the NPC's leader
+ * */
+ void set_leader(Ship *leader);
+
+ /**
+ * @brief game frame
+ * */
+ virtual void frame(const unsigned long elapsed);
+
+
+ /**
+ * @brief factory function for wingman NPCs
+ * */
+ static NPC *add_wingman(Ship *leader);
+
+private:
+ Profile npc_profile;
+
+ Mood npc_mood;
+
+ Ship *npc_leader;
+
+ unsigned long npc_destroyed_timestamp;
+
+}; // class NPC
+
+} // namespace game
+
+#endif // __INCLUDED_BASE_NPC_H__
+