oandxengine.h

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

H
49
字号
// OandxEngine.h
//
// Copyright (c) 2000 - 2006 Symbian Ltd.  All rights reserved.

#ifndef OANDXENGINE_H
#define OANDXENGINE_H

#include <s32std.h>

#include "oandxdefs.h"

class COandXEngine : public CBase
/**
	This engine class represents the board,
	a grid of tiles which can be modified by
	the controller.
 */
	{
public:
	static COandXEngine* NewL();
	virtual ~COandXEngine();
	
	// reset
	void Reset();
	
	// game logic
	TTileState TileStatus(TInt aIndex) const;
	TBool TryMakeMove(TInt aIndex, TBool aCrossTurn);
	TTileState GameWonBy() const;
	
	// persistence
	void ExternalizeL(RWriteStream& aStream) const;
	void InternalizeL(RReadStream& aStream);
	
private:
	COandXEngine();
	
	TInt TileState(TInt aX, TInt aY) const;

private:
	/**
		Each tile's value is represented by an integer,
		ETileBlank, ETileNought, or ETileCross.
	 */
	TFixedArray<TTileState, KNumberOfTiles> iTileStates;
	};

#endif // OANDXENGINE_H

⌨️ 快捷键说明

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