diff options
Diffstat (limited to 'engines/lastexpress/entities/entity.h')
-rw-r--r-- | engines/lastexpress/entities/entity.h | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/engines/lastexpress/entities/entity.h b/engines/lastexpress/entities/entity.h index 3fd2009313..bb2b96618e 100644 --- a/engines/lastexpress/entities/entity.h +++ b/engines/lastexpress/entities/entity.h @@ -616,19 +616,19 @@ public: EntityParameters *getParameters(uint callback, byte index) const; EntityParameters *getCurrentParameters(byte index = 0) { return getParameters(_data.currentCall, index); } - int getCallback(uint callback) const; - int getCurrentCallback() { return getCallback(_data.currentCall); } - void setCallback(uint callback, byte index); - void setCurrentCallback(uint index) { setCallback(_data.currentCall, index); } + int getCallback(uint callback) const; + int getCurrentCallback() { return getCallback(_data.currentCall); } + void setCallback(uint callback, byte index); + void setCurrentCallback(uint index) { setCallback(_data.currentCall, index); } void updateParameters(uint32 index) const; // Serializable - void saveLoadWithSerializer(Common::Serializer &ser); + void saveLoadWithSerializer(Common::Serializer &ser); private: - EntityCallData _data; + EntityCallData _data; EntityCallParameters _parameters[9]; }; @@ -665,9 +665,15 @@ public: protected: LastExpressEngine *_engine; - EntityIndex _entityIndex; - EntityData *_data; - Common::Array<Callback *> _callbacks; + EntityIndex _entityIndex; + EntityData *_data; + Common::Array<Callback *> _callbacks; + + typedef Common::Functor2<const char *, ObjectIndex, void> EnterFunction; + typedef Common::Functor2<CarIndex, EntityPosition, void> UpdateFunction; + + #define WRAP_ENTER_FUNCTION(className, method) new Common::Functor2Mem<const char *, ObjectIndex, void, className>(this, &className::method) + #define WRAP_UPDATE_FUNCTION(className, method) new Common::Functor2Mem<CarIndex, EntityPosition, void, className>(this, &className::method) /** * Saves the game @@ -782,6 +788,33 @@ protected: void enterExitCompartment(const SavePoint &savepoint, EntityPosition position1 = kPositionNone, EntityPosition position2 = kPositionNone, CarIndex car = kCarNone, ObjectIndex compartment = kObjectNone, bool alternate = false, bool updateLocation = false); /** + * Go to compartment. + * + * @param savepoint The savepoint. + * @param compartmentFrom The compartment from. + * @param positionFrom The position from. + * @param sequenceFrom The sequence from. + * @param sequenceTo The sequence to. + * @param enterFunction The enter/exit compartment function. + */ + void goToCompartment(const SavePoint &savepoint, ObjectIndex compartmentFrom, EntityPosition positionFrom, Common::String sequenceFrom, Common::String sequenceTo, EnterFunction *enterFunction); + + /** + * Go to compartment from compartment. + * + * @param savepoint The savepoint. + * @param compartmentFrom The compartment from. + * @param positionFrom The position from. + * @param sequenceFrom The sequence from. + * @param compartmentTo The compartment to. + * @param positionTo The position to. + * @param sequenceTo The sequence to. + * @param enterFunction The enter/exit compartment function. + * @param enterFunction The update entity function. + */ + void goToCompartmentFromCompartment(const SavePoint &savepoint, ObjectIndex compartmentFrom, EntityPosition positionFrom, Common::String sequenceFrom, ObjectIndex compartmentTo, EntityPosition positionTo, Common::String sequenceTo, Entity::EnterFunction *enterFunction, Entity::UpdateFunction *updateFunction); + + /** * Updates the position * * @param savepoint The savepoint |