summaryrefslogtreecommitdiffstats
path: root/sigencore
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-03-28 02:04:53 -0400
committerBen Boeckel <MathStuf@gmail.com>2009-03-28 02:04:53 -0400
commitd94b36ae1953bc0d94df6ea1d3bde2f3f94e376b (patch)
treea0e247d4ad08f1030e37d84d438535f938da081e /sigencore
parentfdd2da24b8cc39a1ed1a2a78a8ce312c35f331e4 (diff)
downloadsigen-d94b36ae1953bc0d94df6ea1d3bde2f3f94e376b.tar.gz
sigen-d94b36ae1953bc0d94df6ea1d3bde2f3f94e376b.tar.xz
sigen-d94b36ae1953bc0d94df6ea1d3bde2f3f94e376b.zip
Move arena and world down to Client
Diffstat (limited to 'sigencore')
-rw-r--r--sigencore/Client.cpp31
-rw-r--r--sigencore/Client.h13
-rw-r--r--sigencore/Player.cpp16
-rw-r--r--sigencore/Player.h8
4 files changed, 45 insertions, 23 deletions
diff --git a/sigencore/Client.cpp b/sigencore/Client.cpp
index a176a335..5cbbca9b 100644
--- a/sigencore/Client.cpp
+++ b/sigencore/Client.cpp
@@ -23,7 +23,10 @@ using namespace Sigencore;
Client::Client(GameWrapper* game, Config* parent) :
Config(parent),
- m_game(game)
+ m_game(game),
+ m_arena(NULL),
+ m_world(NULL),
+ m_canvas(NULL)
{
}
@@ -31,6 +34,11 @@ Client::~Client()
{
}
+Arena* Client::arena()
+{
+ return m_arena;
+}
+
bool Client::enterArena(Arena* arena)
{
m_arena = arena;
@@ -41,3 +49,24 @@ void Client::exitArena()
{
m_arena = NULL;
}
+
+Overworld* Client::world()
+{
+ return m_world;
+}
+
+bool Client::enterWorld(Overworld* world)
+{
+ m_world = world;
+ return true;
+}
+
+void Client::exitWorld()
+{
+ m_world = NULL;
+}
+
+Canvas* Client::canvas()
+{
+ return m_canvas;
+}
diff --git a/sigencore/Client.h b/sigencore/Client.h
index d33c4ce0..058037c4 100644
--- a/sigencore/Client.h
+++ b/sigencore/Client.h
@@ -33,12 +33,22 @@ class GameWrapper;
namespace Sigencore
{
class Arena;
+class Canvas;
+class Overworld;
class SIGENCORE_EXPORT Client : public Sigscript::Config
{
Q_OBJECT
public:
+ Q_SCRIPTABLE Arena* arena();
+
+ Q_SCRIPTABLE Overworld* world();
+
+ Q_SCRIPTABLE Canvas* canvas();
+ public slots:
+ virtual bool enterWorld(Overworld* world);
+ virtual void exitWorld();
virtual bool enterArena(Arena* arena);
virtual void exitArena();
@@ -48,6 +58,9 @@ class SIGENCORE_EXPORT Client : public Sigscript::Config
Sigscript::GameWrapper* m_game;
Arena* m_arena;
+ Overworld* m_world;
+ Canvas* m_canvas;
+ Client* m_client;
};
}
diff --git a/sigencore/Player.cpp b/sigencore/Player.cpp
index 85787936..ebd9c7b4 100644
--- a/sigencore/Player.cpp
+++ b/sigencore/Player.cpp
@@ -32,8 +32,6 @@ using namespace Sigencore;
Player::Player(GameWrapper* game, Config* parent) :
Client(game, parent),
- m_world(NULL),
- m_arena(NULL),
m_team(new Team(game, this)),
m_money(0)
{
@@ -43,24 +41,14 @@ Player::~Player()
{
}
-Overworld* Player::world() const
-{
- return m_world;
-}
-
bool Player::enterWorld(Overworld* world)
{
- // TODO
+ return Client::enterWorld(world);
}
void Player::exitWorld()
{
- // TODO
-}
-
-Arena* Player::arena() const
-{
- return m_arena;
+ Client::exitWorld();
}
bool Player::enterArena(Arena* arena)
diff --git a/sigencore/Player.h b/sigencore/Player.h
index 9e8de7ab..3ae9de78 100644
--- a/sigencore/Player.h
+++ b/sigencore/Player.h
@@ -34,8 +34,6 @@ class ItemWrapper;
namespace Sigencore
{
-class Arena;
-class Overworld;
class Team;
class SIGENCORE_EXPORT Player : public Client
@@ -46,10 +44,6 @@ class SIGENCORE_EXPORT Player : public Client
Player(Sigscript::GameWrapper* game, Sigscript::Config* parent);
virtual ~Player();
- Q_SCRIPTABLE Overworld* world() const;
-
- Q_SCRIPTABLE Arena* arena() const;
-
Q_SCRIPTABLE Team* team() const;
Q_SCRIPTABLE TeamMember* findMember(const QUuid& id) const;
Q_SCRIPTABLE QList<TeamMember*> active() const;
@@ -83,8 +77,6 @@ class SIGENCORE_EXPORT Player : public Client
void moneyChanged(const int money);
protected:
- Overworld* m_world;
- Arena* m_arena;
Team* m_team;
QList<TeamMember*> m_active;
QMap<Sigscript::ItemWrapper*, int> m_items;