From 5bbbdc24293ad1138a0b93628f7d28f8b249b92d Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 25 Jan 2015 20:24:40 +0000 Subject: Added support for default player characters when joining a game. --- src/game/base/character.cc | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 src/game/base/character.cc (limited to 'src/game/base/character.cc') 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 -- cgit v1.2.3