Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 16, 2011, 6:21:05 PM (14 years ago)
Author:
sven
Message:

Added docking animations, skeletton for DockingController..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/dockingsystem2/src/modules/docking/Dock.h

    r8434 r8493  
    4646
    4747#include "DockingEffect.h"
     48#include "DockingAnimation.h"
    4849#include "DockingPrereqs.h"
    4950
     
    5859        virtual ~Dock();
    5960
     61        // Trigger interface
     62        bool execute(bool bTriggered, BaseObject* trigger);
     63
     64        // XML interface
    6065        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
    6166        virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
    6267
    63         bool execute(bool bTriggered, BaseObject* trigger);
    64 
     68        // XML functions
    6569        bool addEffect(DockingEffect* effect); //!< Add a DockingEffect to the Dock.
    6670        const DockingEffect* getEffect(unsigned int index) const; //!< Get the DockingEffect at a given index.
     71        bool addAnimation(DockingAnimation* animation); //!< Add a DockingAnimation to the Dock.
     72        const DockingAnimation* getAnimation(unsigned int index) const; //!< Get the DockingAnimation at a given index.
    6773
     74        // Docking/undocking logic, checks conditions and invokes the DockingAnimations
    6875        bool dock(PlayerInfo* player); //!< Returns true if given player docked successfully (player must be a candidate)
    6976        bool undock(PlayerInfo* player); //!< Undocks a player (player must be docked)
    7077
     78        // Animation logic
     79        bool dockingAnimationFinished(PlayerInfo* player); //!< Called when a docking animation finished
     80        bool undockingAnimationFinished(PlayerInfo* player); //!< Called when a undocking animation finished
     81
     82        // LUA interface
    7183        void dock() { this->dock(HumanController::getLocalControllerSingleton()->getPlayer()); } // tolua_export
    7284        static unsigned int getNumberOfActiveDocks(); // tolua_export
    7385        static Dock* getActiveDockAtIndex(unsigned int index); // tolua_export
    7486
     87        // Console commands
    7588        static void cmdDock();
    7689        static void cmdUndock();
     
    7992        std::set<PlayerInfo*> candidates; //!< A set of all players which are allowed to dock using the console command.
    8093        std::set<PlayerInfo*> docked; //!< A set of all docked players
     94
    8195        std::list<DockingEffect*> effects; //!< The list of DockingEffects to be executed when a player docks.
     96        std::list<DockingAnimation*> animations; //!< The list of DockingAnimations to be executed before a player docks
    8297    }; // tolua_export
    8398} // tolua_export
Note: See TracChangeset for help on using the changeset viewer.