From 2218c7094ad6dc40b200274ebffdc9fb4c1a8e0c Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 9 Nov 2013 20:15:06 +0000 Subject: Removed shipmodel npcname support, made Patrols load NPC types instead of ship models, replaces patrol [ship] subsection with a [npc] subsection. --- src/game/base/npctype.cc | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/game/base/npctype.cc (limited to 'src/game/base/npctype.cc') diff --git a/src/game/base/npctype.cc b/src/game/base/npctype.cc new file mode 100644 index 0000000..f44cc1f --- /dev/null +++ b/src/game/base/npctype.cc @@ -0,0 +1,71 @@ +/* + 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 +*/ + +#include "base/npctype.h" + +namespace game +{ + +NPCType::NPCType() : + npctype_name() +{ + npctype_amount = 1; + npctype_merchant = false; + + npctype_faction = 0; + npctype_shipmodel = 0; + + npctype_cannon = 0; + npctype_turret = 0; +} + + +NPCType::~NPCType() +{ + // clear pointers + npctype_faction = 0; + npctype_shipmodel = 0; + + npctype_cannon = 0; + npctype_turret = 0; +} + +void NPCType::set_name(const std::string &name) +{ + npctype_name.assign(name); +} + +void NPCType::set_amount(const long amount) +{ + npctype_amount = amount; +} + +void NPCType::set_merchant(const bool is_merchant) +{ + npctype_merchant = is_merchant; +} + +void NPCType::set_faction(const Faction *faction) +{ + npctype_faction = faction; +} + +void NPCType::set_shipmodel(const ShipModel *shipmodel) +{ + npctype_shipmodel = shipmodel; +} + +void NPCType::set_cannon(const Weapon *cannon) +{ + npctype_cannon = cannon; +} + +void NPCType::set_turret(const Weapon *turret) +{ + npctype_turret = turret; +} + +} // namespace game -- cgit v1.2.3