mopoidlevels.h

来自「mopoid game symbian os application devel」· C头文件 代码 · 共 64 行

H
64
字号
/*
========================================================================
 Name        : MopoidLevels.h
 Author      :
 Copyright   : 
 Description : Loads and manages level definitions.
 License     : 
 
========================================================================
*/
#ifndef __MOPOIDLEVELS_H__
#define __MOPOIDLEVELS_H__

#include <eikenv.h>
#include <aknutils.h>
#include "MopoidGrid.h"
#include "CommonFunctions.h"
#include "MopoidSharedData.h"
#include "MopoidSettings.h"

_LIT(KLevelsDataFile, "levels.dat");
_LIT8(KNewLevel8, "---");

/**
 * Loads level layouts and stores them.
 */
class TMopoidLevels {
public:
	TMopoidLevels();
	
    /**
     * Load the level file and store its contents.
     */
    void LoadLevelL(RFs& aFs, const TInt aLevelNum,
    		CMopoidGrid* aGrid, CMopoidSettings* aSettings);

private:
    /**
     * Reads a file into a descriptor.
     * @param inPath the full path + filename of the file to read.
     * @return a heap descriptor containing the contents of the file.
     */
    HBufC8* ReadFileL(RFs& aFs, const TDesC& inPath);

    /**
     * Searches the next occurence of the specified separator in the string
     * and returns a pointer from the previous to the new separator pos.
     * @param aLex the lex class for analyzing the string.
     * @param aSeparator separating char.
     * @return a TPtr to the part of the text between the previous separator pos
     * and the new one.
     */
	TPtrC8 ExtractToken(TLex8& aLex, const TChar aSeparator);

	TInt ReadLineNumberIntL(TLex8& aFileLex);
	TReal ReadLineNumberFloatL(TLex8& aFileLex);
public:
	TInt iNumLevels;
	
	const TChar KNewLine;
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?