1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
/********************************************************************
*
*	File:		fsILevelBasedAppCoreMain.h
*
*	Purpose:	Interface for level based apps
*
*********************************************************************/

#ifndef fsILevelBasedAppCoreMainhdr
#define fsILevelBasedAppCoreMainhdr

#include <memory>
#include <vector>

#include <fsAppCore/src/fsCAppCoreMain.h>
#include <fsCore/src/fsCUniqueId.h>

class fsIRunningOrder;
class fsCVariableTable;
class fsISubSceneComponent;

class fsILevelBasedAppCoreMain : public fsCAppCoreMain
{
	friend class gfCDebugJustCollectablesView;

public:

	static const fsCUniqueId mLevelInitialisedMsg;
	static const fsCUniqueId mLevelEntitiesCreatedMsg;
	static const fsCUniqueId mLevelPostResetMsg;
	void chapterEnable();
	static void chapterLoaderEnable();

	void chapterClear();
	static fsStr chapterFolderGet();
	std::vector<fsStr>	chaptersGet() const;<--- Function 'chaptersGet()' should return member 'mChapters' by const reference.

	static fsStr scenesFolderGet();
	fsStr sceneFolderGet() const;

	static fsBool collectorsEditionContent(const fsStr& pLevelName);

	static fsILevelBasedAppCoreMain* instanceGet();

	fsS32 levelCountGet() const;
	fsS32 currLevelPosGet() const;

	fsISubSceneComponent* currentSubSceneGet() const;
	void subScenesStore();

	fsCVariableTable* levelSettingsGet() const;

	void quitToMenuSet();

	fsStr currentLevelNameGet() const;

	void levelCompleteSet();
	void gameSingleLevel();
	void gameContinue();
	void newGameStart();
	void nextLocationSet(const fsStr& pNextLevelName);
	fsStr nextLocationGet() const;
	fsStr nextLocationGet(const fsStr& pCurrentLocation) const;
	const fsStr& firstLocationGet() const;

	const std::vector<fsStr>& rawSequenceGet() const;

	virtual void runningOrderCreate() = 0;
	virtual void runningOrderReplace(const std::vector<fsStr> pNewOrder) = 0;

protected:

	fsBool nextLocationReady() const;

	void postInitialiseDo() override;

	void nextLocationInitialise();

	virtual void nextLocationInitialiseDo(const fsStr& pLevelName)
	{
	}

	fsILevelBasedAppCoreMain();
	virtual ~fsILevelBasedAppCoreMain();<--- Destructor in derived class

	void chaptersLocate();

	fsIRunningOrder* mRunningOrder;
	fsStr mCurrentLevelName;
	fsStr mCurrentChapter;

private:

	void cachesFlush();

	void currentSubSceneBackgroundVisiblityToggle(fsBool pRender);

	void levelSettingsLoad();

    static const fsStr mScenesFolder;
	static const fsStr mChaptersFolder;

	std::unique_ptr<fsCVariableTable> mLevelSettings;

	std::vector<fsISubSceneComponent*> mSubScenes;

	std::vector<fsStr> mChapters;
};

#endif