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>2015-01-25 20:24:40 +0000
committerStijn Buys <ingar@osirion.org>2015-01-25 20:24:40 +0000
commit5bbbdc24293ad1138a0b93628f7d28f8b249b92d (patch)
tree52095645725b7debf6a1a304ffe4e119e1b7ac90 /src/game/base/character.cc
parentcd30cd33b8b78343f0edcc29ac07fa5bd1b844bd (diff)
Added support for default player characters when joining a game.
Diffstat (limited to 'src/game/base/character.cc')
-rw-r--r--src/game/base/character.cc75
1 files changed, 75 insertions, 0 deletions
diff --git a/src/game/base/character.cc b/src/game/base/character.cc
new file mode 100644
index 0000000..ceb5ff4
--- /dev/null
+++ b/src/game/base/character.cc
@@ -0,0 +1,75 @@
+/*
+ base/character.cc
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
+*/
+
+#include "base/character.h"
+
+namespace game
+{
+
+Character::Character() : core::Label()
+{
+ _spawn = 0;
+ _faction = 0;
+ _shipmodel = 0;
+ _cannon = 0;
+ _turret = 0;
+
+ _level = 1;
+ _credits = 0;
+}
+
+Character::Character(const Character & other) : core::Label(other)
+{
+ _spawn = other._spawn;
+ _faction = other._faction;
+ _shipmodel = other._shipmodel;
+ _cannon = other._cannon;
+ _turret = other._turret;
+
+ _level = other._level;
+ _credits = other._credits;
+}
+
+Character::~Character()
+{
+}
+
+void Character::set_spawn(core::Entity *spawn)
+{
+ _spawn = spawn;
+}
+
+void Character::set_faction(const Faction *faction)
+{
+ _faction = faction;
+}
+
+void Character::set_shipmodel(const ShipModel *shipmodel)
+{
+ _shipmodel = shipmodel;
+}
+
+void Character::set_cannon(const Weapon *cannon)
+{
+ _cannon = cannon;
+}
+
+void Character::set_turret(const Weapon *turret)
+{
+ _turret = turret;
+}
+
+void Character::set_level(const core::Level level)
+{
+ _level = level;
+}
+
+void Character::set_credits(const long credits)
+{
+ _credits = credits;
+}
+
+} // namespace game \ No newline at end of file