/********************************************************************
*
* Created: 8/4/2014 17:26
*
* File: fsIPickListEntryGui.h
*
* Author: Mick Waites
*
* Purpose: Base for the different pick list gui entry types.
*
*********************************************************************/
#ifndef fsIPickListEntryGuihdr
#define fsIPickListEntryGuihdr
#include <vector>
#include <fsAppCore/src/components/gui/fsIMessageListenerGuiComponent.h>
class fsITextSpriteComponent;
class gfIPickListEntryGui : public fsIMessageListenerGuiComponent
{
public:
static const fsCUniqueId mAddedEntryToPickListdMsg;
fsCEntity* const firstEntityGet() const;
void postLoadRelink(const std::vector<fsCEntity*>& pMyEntities);
fsBool entityNameMatchGet(const fsStr& pMatch) const;
fsStr entityLocalisedNameGet() const;
void uncollectedEntitiesInSubSceneAddToVec(std::vector<fsCEntity*>& pVec, fsS32 pSubSceneIndex) const;
void deactivate();
void activate(const std::vector<fsCEntity*>& pMyEntities, fsS32 pTotalEntitiesToCollect);
fsBool isActiveGet() const;
fsBool collectionCompleteGetAndReset();
protected:
enum
{
eSTATE_INACTIVE = 0,
eSTATE_TRANSITION_ON,
eSTATE_WAITING_FOR_COLLECTION,
eSTATE_COLLECTED_TRANSITION_OFF,
eSTATE_COLLECTION_COMPLETE
};
std::vector<fsCEntity*> entitiesGet() const;<--- Function 'entitiesGet()' should return member 'mMyEntities' by const reference.
void stateSet(fsS32);
fsS32 stateGet() const;
void numberToCollectSet(fsS32 pNumToCollect);
fsS32 numberToCollectGet() const;
void updateDo(fsS32 pDeltaMs) override;
void serialiseDo() override;
void deserialiseDo() override;
void resetDo() override;
void listenersRegisterDo() override;
void listenersDeregisterDo() override;
fsBool messageProcessDo(const fsCUniqueId& pMessageType,
const fsIMessageDispatcher::sMessageParameters& pParam) override;
gfIPickListEntryGui(fsCEntity* pParent);
virtual ~gfIPickListEntryGui();
private:
virtual void uncollectedEntitiesInSubSceneAddToVecDo(std::vector<fsCEntity*>& pVec, fsS32 pSubSceneIndex) const
{
};
virtual void activateDo(std::vector<fsCEntity*> pMyEntities) = 0;
virtual void deactivateDo() = 0;
virtual fsBool transitionOnUpdate(fsS32 pDeltaMs) = 0;
virtual fsBool transitionOffUpdate(fsS32 pDeltaMs) = 0;
virtual fsBool entityCollectedHandle() = 0;
virtual void entitiesMakeCollectableDo(fsS32 pTotalEntitiesToCollect)
{
}
void entitiesMakeCollectable(fsS32 pTotalEntitiesToCollect);
std::vector<fsCEntity*> mMyEntities;
fsS32 mNumToCollect;
fsStr mEntityLocalisedName;
fsS32 mState;
};
#endif