chighscores.h

来自「symbian 的一个 二维飞行游戏 源码 及相关技术文章」· C头文件 代码 · 共 50 行

H
50
字号
// Copyright 2002 Kenneth Guy,
// 
// CHighScores.h
//


#ifndef _CHIGHSCORE_H_
#define _CHIGHSCORE_H_

/** \file CHighScores.h 
    defines class CHighScores */


#include <e32std.h>
#include <e32base.h>

/** High score table.
    
    Handles saving and restoring the high score table. */

class CHighScores : public CBase {
public:
  static CHighScores* NewL(const TDesC& aFileName);
  
  TInt  Number();
  void  AddScoreL(const TDesC& aName, TInt aScore);
  TBool GoodEnough(TInt aScore);
  TInt  Score(TInt aEntry);
  const TDesC& Name(TInt aEntry);
  TInt LastAdded();

  ~CHighScores();
  void InitL();

private:
  void ConstructL(const TDesC& aFileName);

  void SaveL();
  void LoadL();
  void Reset();
          
private:
  HBufC*          iFileName; ///< file to store high score table in on exit
  RArray<HBufC*>  iNames; ///< Array of names
  RArray<TInt>    iScores;///< Array of scores
  TInt            iLastAdded; ///< Last added, so that ui can highlite it.
};

#endif

⌨️ 快捷键说明

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