LASTEXPRESS: More include re-organization

This commit is contained in:
Littleboy 2012-07-27 00:54:24 -04:00
parent 115a4d36ba
commit 6aeda2638b
14 changed files with 29 additions and 18 deletions

View file

@ -34,6 +34,7 @@
#include "lastexpress/game/action.h"
#include "lastexpress/game/beetle.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/game/inventory.h"
#include "lastexpress/game/logic.h"
#include "lastexpress/game/object.h"

View file

@ -26,10 +26,8 @@
#include "lastexpress/game/action.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/game/logic.h"
#include "lastexpress/game/object.h"
#include "lastexpress/game/savegame.h"
#include "lastexpress/game/savepoint.h"
#include "lastexpress/game/scenes.h"
namespace LastExpress {

View file

@ -25,9 +25,12 @@
#include "lastexpress/shared.h"
#include "lastexpress/sound/sound.h"
#include "lastexpress/game/logic.h"
#include "lastexpress/game/savepoint.h"
#include "lastexpress/game/state.h"
#include "lastexpress/sound/sound.h"
#include "lastexpress/lastexpress.h"
#include "lastexpress/helpers.h"
@ -864,9 +867,6 @@ private:
class Entity : Common::Serializable {
public:
typedef Common::Functor1<const SavePoint&, void> Callback;
Entity(LastExpressEngine *engine, EntityIndex index);
virtual ~Entity();
@ -900,6 +900,7 @@ public:
protected:
LastExpressEngine *_engine;
typedef Common::Functor1<const SavePoint&, void> Callback;
EntityIndex _entityIndex;
EntityData *_data;

View file

@ -31,6 +31,7 @@
#include "lastexpress/data/cursor.h"
#include "lastexpress/data/sequence.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/game/inventory.h"
#include "lastexpress/game/logic.h"
#include "lastexpress/game/object.h"
@ -38,8 +39,10 @@
#include "lastexpress/game/state.h"
#include "lastexpress/sound/queue.h"
#include "lastexpress/sound/sound.h"
#include "lastexpress/graphics.h"
#include "lastexpress/helpers.h"
#include "lastexpress/lastexpress.h"
#include "lastexpress/resource.h"

View file

@ -26,6 +26,7 @@
#include "lastexpress/data/scene.h"
#include "lastexpress/data/snd.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/game/logic.h"
#include "lastexpress/game/scenes.h"
#include "lastexpress/game/state.h"
@ -33,8 +34,10 @@
#include "lastexpress/menu/menu.h"
#include "lastexpress/sound/queue.h"
#include "lastexpress/sound/sound.h"
#include "lastexpress/graphics.h"
#include "lastexpress/helpers.h"
#include "lastexpress/lastexpress.h"
#include "lastexpress/resource.h"

View file

@ -36,6 +36,7 @@
// Game
#include "lastexpress/game/action.h"
#include "lastexpress/game/beetle.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/game/inventory.h"
#include "lastexpress/game/object.h"
#include "lastexpress/game/savegame.h"

View file

@ -25,8 +25,6 @@
#include "lastexpress/shared.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/eventhandler.h"
#include "common/events.h"

View file

@ -22,6 +22,7 @@
#include "lastexpress/game/object.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/game/logic.h"
#include "lastexpress/game/scenes.h"
#include "lastexpress/game/state.h"

View file

@ -22,6 +22,7 @@
#include "lastexpress/game/savegame.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/game/inventory.h"
#include "lastexpress/game/logic.h"
#include "lastexpress/game/object.h"

View file

@ -94,7 +94,7 @@ void SavePoints::process() {
if (!updateEntityFromData(savepoint)) {
// Call requested callback
Entity::Callback *callback = getCallback(savepoint.entity1);
Callback *callback = getCallback(savepoint.entity1);
if (callback && callback->isValid()) {
debugC(8, kLastExpressDebugLogic, "Savepoint: entity1=%s, action=%s, entity2=%s", ENTITY_NAME(savepoint.entity1), ACTION_NAME(savepoint.action), ENTITY_NAME(savepoint.entity2));
(*callback)(savepoint);
@ -125,7 +125,7 @@ void SavePoints::addData(EntityIndex entity, ActionIndex action, uint32 param) {
//////////////////////////////////////////////////////////////////////////
// Callbacks
//////////////////////////////////////////////////////////////////////////
void SavePoints::setCallback(EntityIndex index, Entity::Callback *callback) {
void SavePoints::setCallback(EntityIndex index, Callback *callback) {
if (index >= 40)
error("[SavePoints::setCallback] Attempting to use an invalid entity index. Valid values 0-39, was %d", index);
@ -135,7 +135,7 @@ void SavePoints::setCallback(EntityIndex index, Entity::Callback *callback) {
_callbacks[index] = callback;
}
Entity::Callback *SavePoints::getCallback(EntityIndex index) const {
Callback *SavePoints::getCallback(EntityIndex index) const {
if (index >= 40)
error("[SavePoints::getCallback] Attempting to use an invalid entity index. Valid values 0-39, was %d", index);
@ -149,7 +149,7 @@ void SavePoints::call(EntityIndex entity2, EntityIndex entity1, ActionIndex acti
point.entity2 = entity2;
point.param.intValue = param;
Entity::Callback *callback = getCallback(entity1);
Callback *callback = getCallback(entity1);
if (callback != NULL && callback->isValid()) {
debugC(8, kLastExpressDebugLogic, "Savepoint: entity1=%s, action=%s, entity2=%s, param=%d", ENTITY_NAME(entity1), ACTION_NAME(action), ENTITY_NAME(entity2), param);
(*callback)(point);
@ -163,7 +163,7 @@ void SavePoints::call(EntityIndex entity2, EntityIndex entity1, ActionIndex acti
point.entity2 = entity2;
strcpy((char *)&point.param.charValue, param);
Entity::Callback *callback = getCallback(entity1);
Callback *callback = getCallback(entity1);
if (callback != NULL && callback->isValid()) {
debugC(8, kLastExpressDebugLogic, "Savepoint: entity1=%s, action=%s, entity2=%s, param=%s", ENTITY_NAME(entity1), ACTION_NAME(action), ENTITY_NAME(entity2), param);
(*callback)(point);
@ -180,7 +180,7 @@ void SavePoints::callAndProcess() {
bool isRunning = getFlags()->isGameRunning;
while (isRunning) {
Entity::Callback *callback = getCallback(index);
Callback *callback = getCallback(index);
if (callback != NULL && callback->isValid()) {
(*callback)(savepoint);
isRunning = getFlags()->isGameRunning;

View file

@ -74,10 +74,9 @@ struct SavePoint {
}
};
class SavePoints : Common::Serializable {
private:
typedef Common::Functor1<const SavePoint&, void> Callback;
class SavePoints : Common::Serializable {
public:
struct SavePointData {
@ -112,7 +111,7 @@ public:
void addData(EntityIndex entity, ActionIndex action, uint32 param);
// Callbacks
void setCallback(EntityIndex index, Entity::Callback *callback);
void setCallback(EntityIndex index, Callback *callback);
Callback *getCallback(EntityIndex entity) const;
void call(EntityIndex entity2, EntityIndex entity1, ActionIndex action, uint32 param = 0) const;
void call(EntityIndex entity2, EntityIndex entity1, ActionIndex action, const char *param) const;

View file

@ -32,8 +32,10 @@
#include "lastexpress/menu/menu.h"
#include "lastexpress/sound/queue.h"
#include "lastexpress/sound/sound.h"
#include "lastexpress/graphics.h"
#include "lastexpress/helpers.h"
#include "lastexpress/resource.h"
#include "common/config-manager.h"

View file

@ -30,6 +30,7 @@
#include "lastexpress/fight/fight.h"
#include "lastexpress/game/entities.h"
#include "lastexpress/game/inventory.h"
#include "lastexpress/game/logic.h"
#include "lastexpress/game/savegame.h"

View file

@ -26,7 +26,9 @@
#include "lastexpress/game/state.h"
#include "lastexpress/sound/entry.h"
#include "lastexpress/sound/sound.h"
#include "lastexpress/helpers.h"
#include "lastexpress/lastexpress.h"
namespace LastExpress {