oandxcontroller.h

来自「Symbian OS C++ for Mobile Phones v3 Exam」· C头文件 代码 · 共 68 行

H
68
字号
// 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>

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();

	// state
	enum TState
		{
		ENewGame, EPlaying, EFinished
		};

	inline TInt State() const;
	inline TBool IsNewGame() const;
	inline TBool IsCrossTurn() const;

	// 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;
	};

// state inlines
inline TBool COandXController::IsNewGame() const { return iState==ENewGame; }
inline TInt  COandXController::State() const { return (iState); }
inline TBool COandXController::IsCrossTurn() const { return (iCrossTurn); }

#endif // OANDXCONTROLLER_H

⌨️ 快捷键说明

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