?? oandxcontroller.h
字號:
// OandXController.h
//
// Copyright (c) 2006 Symbian Ltd. All rights reserved.
//
#ifndef OANDXCONTROLLER_H
#define OANDXCONTROLLER_H
#include <coecntrl.h>
#include <coemain.h>
#include <eikappui.h>
#include <eikapp.h>
#include <eikdoc.h>
#include <eikenv.h>
#include <eikon.hrh>
#include "oandxdefs.h"
class COandXEngine;
#define MaxInfoNoteTextLen 40
class COandXController : public CBase
/**
This controller uses instructions from the user to update the
engine (board.)
*/
{
public:
static COandXController* NewL();
virtual ~COandXController();
// game control
void ResetL();
TBool HitSquareL(TInt aIndex);
void SwitchTurn();
void ResetStats();
// state
enum TState
{
ENewGame, EPlaying, EFinished
};
inline TInt State() const;
inline TBool IsNewGame() const;
inline TBool IsCrossTurn() const;
inline TUint GamesPlayed() const;
inline TUint WonByO() const;
inline TUint WonByX() const;
TTileState GameRecord(TInt aIndex);
// stream persistence
void ExternalizeL(RWriteStream& aStream) const;
void InternalizeL(RReadStream& aStream);
private:
void ConstructL();
void SetStateL(TState aState);
private:
// private persistent state
TState iState;
TBool iCrossTurn;
TTileState iLastGameResult;
TUint iNumGames;
TUint iNumNoughtWins;
TUint iNumCrossWins;
TFixedArray<TTileState, KNumHistoryRecords> iGameRecords;
};
// state inlines
inline TBool COandXController::IsNewGame() const { return iState==ENewGame; }
inline TInt COandXController::State() const { return (iState); }
inline TBool COandXController::IsCrossTurn() const { return (iCrossTurn); }
inline TUint COandXController::GamesPlayed() const { return iNumGames; }
inline TUint COandXController::WonByO() const { return iNumNoughtWins; }
inline TUint COandXController::WonByX() const { return iNumCrossWins; }
#endif // OANDXCONTROLLER_H
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -