examples/SFExamples/games_on_symbian_os_code/oandx/inc/oandxcontroller.h

00001 // 
00002 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
00003 // All rights reserved.
00004 // This component and the accompanying materials are made available
00005 // under the terms of the License "Eclipse Public License v1.0"
00006 // which accompanies this distribution, and is available
00007 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
00008 // 
00009 // Initial Contributors:
00010 // Nokia Corporation - initial contribution.
00011 // 
00012 // Contributors:
00013 // 
00014 // Description:
00015 // 
00016 
00017 #ifndef OANDXCONTROLLER_H
00018 #define OANDXCONTROLLER_H
00019 
00020 #include <coecntrl.h>
00021 #include <coemain.h>
00022 
00023 #include <eikappui.h>
00024 #include <eikapp.h>
00025 #include <eikdoc.h>
00026 #include <eikenv.h>
00027 #include <eikon.hrh>
00028 
00029 class COandXEngine;
00030 
00031 #define MaxInfoNoteTextLen 40
00032 
00033 class COandXController : public CBase
00038         {
00039 public:
00040         static COandXController* NewL();
00041         virtual ~COandXController();
00042 
00043         // game control
00044         void Reset();
00045         TBool HitSquareL(TInt aIndex);
00046         void SwitchTurn();
00047 
00048         // state
00049         enum TState
00050                 {
00051                 ENewGame, EPlaying, EFinished
00052                 };
00053 
00054         inline TBool IsNewGame() const;
00055         inline TBool IsCrossTurn() const;
00056 
00057         // stream persistence
00058         void ExternalizeL(RWriteStream& aStream) const;
00059         void InternalizeL(RReadStream& aStream);
00060         
00061 private:
00062         void ConstructL();
00063         
00064 private:
00065         // private persistent state
00066         TState iState;
00067         TBool iCrossTurn;
00068         };
00069 
00070 // state inlines
00071 inline TBool COandXController::IsNewGame() const { return iState==ENewGame; }
00072 inline TBool COandXController::IsCrossTurn() const { return (iCrossTurn); }
00073         
00074 #endif // OANDXCONTROLLER_H

Generated by  doxygen 1.6.2