// BOSSENG.H
//
// Copyright (c) 1998 Symbian Ltd.  All rights reserved.
//

#ifndef __BOSSENG_H
#define __BOSSENG_H

#include <e32std.h>

class TBossPuzzle
	{
public:
	enum TMoveType { EUp, EDown, ELeft, ERight }; // types of move
public:
	// construct
	IMPORT_C TBossPuzzle();
	// initialize state
	IMPORT_C void SetFullyOrdered(); // all tiles in order
	IMPORT_C void SetBossOrdered(); // 14 and 15 swapped
	// inquiry
	IMPORT_C TBool IsFullyOrdered() const;
	IMPORT_C TBool IsBlank(TInt aRow, TInt aCol) const;
	IMPORT_C const TInt& Tile(TInt aRow, TInt aCol) const;
	IMPORT_C TInt& Tile(TInt aRow, TInt aCol);
	IMPORT_C void LocateTile(TInt aTileNumber, TInt& aRow, TInt& aCol) const;
	IMPORT_C void LocateBlank(TInt& aRow, TInt& aCol) const;
	// whether various moves are possible
	IMPORT_C TBool CanMove(TMoveType aMoveType) const;
	IMPORT_C TBool CanMove(TInt aRow, TInt aCol) const;
	IMPORT_C TMoveType CanMoveType(TInt aRow, TInt aCol) const;
	// moving - these functions panic if impossible
	IMPORT_C void Move(TMoveType aMoveType);
	IMPORT_C void Move(TInt aRow, TInt aCol);
private:
	TInt iTiles[16]; // simple C array for tiles
	};

#endif
