Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/player_8h-source.html
Week 12 contribution of SDK documentation_content. See release notes for details. Fixes Bug 1892, Bug 1522, Bug 1520, Bug 394, Bug 1319, Bug 344, Bug 1897
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>TB10.1 Example Applications: examples/Bluetooth/BTExample1/inc/player.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<h1>examples/Bluetooth/BTExample1/inc/player.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
<a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
<a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
<a name="l00004"></a>00004 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span>
<a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
<a name="l00006"></a>00006 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span>
<a name="l00007"></a>00007 <span class="comment">//</span>
<a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
<a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
<a name="l00010"></a>00010 <span class="comment">//</span>
<a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
<a name="l00012"></a>00012 <span class="comment">//</span>
<a name="l00013"></a>00013 <span class="comment">// Description:</span>
<a name="l00014"></a>00014 <span class="comment">//</span>
<a name="l00015"></a>00015
<a name="l00016"></a>00016 <span class="preprocessor">#ifndef PLAYER_H</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define PLAYER_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019
<a name="l00020"></a>00020 <span class="preprocessor">#include <e32base.h></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include <es_sock.h></span>
<a name="l00022"></a>00022 <span class="preprocessor">#include <in_sock.h></span>
<a name="l00023"></a>00023 <span class="preprocessor">#include "gameconstants.h"</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include "cardgameplayer.h"</span>
<a name="l00025"></a>00025
<a name="l00026"></a>00026
<a name="l00035"></a><a class="code" href="class_c_scabby_queen_player.html">00035</a> <span class="keyword">class </span><a class="code" href="class_c_scabby_queen_player.html">CScabbyQueenPlayer</a> : <span class="keyword">public</span> <a class="code" href="class_c_card_game_player.html">CCardGamePlayer</a>
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 <span class="keyword">public</span>:
<a name="l00038"></a>00038 <span class="keyword">static</span> <a class="code" href="class_c_scabby_queen_player.html">CScabbyQueenPlayer</a>* <a class="code" href="class_c_scabby_queen_player.html#bee293bd382ccbc153e056bee360ab53">NewL</a>(CConsoleBase& aConsole, RSocket& aSocket);
<a name="l00039"></a>00039 <a class="code" href="class_c_scabby_queen_player.html#aee6cd05f718878fbb14a125d1c68ccf">~CScabbyQueenPlayer</a>();
<a name="l00040"></a>00040 <span class="comment">// implementations of virtual functions here</span>
<a name="l00041"></a>00041 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_player.html#dc0fb89a4281db6471fb4a12ccc3be71">SendComplete</a>(TInt aError);
<a name="l00042"></a>00042 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_player.html#28fc5c6bcac60e9605e726fb8b8d5df1">RecvComplete</a>(TInetAddr aRecvAddr,TInt aError);
<a name="l00043"></a>00043 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_player.html#585a26b848b1f4a604d74c2a5b56fb21">TimerComplete</a>();
<a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_player.html#322f4b7790c5bd0d14ad8aa3d06b0208">ShowHandL</a>();
<a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_player.html#4871f690508127ff7fd50a21d3f094a5">GetRightHandPlayerCard</a>();<span class="comment">// Not actually a get function</span>
<a name="l00046"></a>00046 TInt <a class="code" href="class_c_scabby_queen_player.html#59a8469dec43a2d7993837e7fb433bc5">SendCardNum</a>(TInt aCardNum);
<a name="l00047"></a>00047
<a name="l00048"></a>00048 <span class="keyword">private</span>:
<a name="l00049"></a>00049 <span class="keywordtype">void</span> RecvOfHandComplete();
<a name="l00050"></a>00050 <span class="keywordtype">void</span> RecvOfPlayerNumComplete();
<a name="l00051"></a>00051 <span class="keywordtype">void</span> FindPairsAndRemove();
<a name="l00052"></a>00052 <span class="keywordtype">void</span> RecvOfPlayTokenComplete();
<a name="l00053"></a>00053 <span class="keywordtype">void</span> SendOfCardComplete();
<a name="l00054"></a>00054 <span class="keywordtype">void</span> RecvOfCardComplete();
<a name="l00055"></a>00055 <span class="keywordtype">void</span> SendCard();
<a name="l00056"></a>00056 <span class="keywordtype">void</span> ReceiveNextRole();
<a name="l00057"></a>00057 <span class="keywordtype">void</span> SendGameStatus();
<a name="l00058"></a>00058 <span class="keywordtype">void</span> RecvUpdate();
<a name="l00059"></a>00059 <span class="keywordtype">void</span> SendReadyForUpdateComplete();
<a name="l00060"></a>00060 <span class="keywordtype">void</span> SentTokenRecvSuccess();
<a name="l00061"></a>00061 <span class="keywordtype">void</span> SentCardRecvNotification();
<a name="l00062"></a>00062 <span class="keywordtype">void</span> SentGameStatus();
<a name="l00063"></a>00063 <span class="keywordtype">void</span> SentReadyForToken();
<a name="l00064"></a>00064 <span class="keywordtype">void</span> SendOfCardNumberComplete();
<a name="l00065"></a>00065 <span class="keywordtype">void</span> SentHandSize();
<a name="l00066"></a>00066 <span class="keywordtype">void</span> RecvHandSize();
<a name="l00067"></a>00067 <span class="keywordtype">void</span> SendCardComplete();
<a name="l00068"></a>00068 <span class="keywordtype">void</span> SendAck();
<a name="l00069"></a>00069 <span class="keywordtype">void</span> SendAckAfterRecvCard();
<a name="l00070"></a>00070 <span class="keywordtype">void</span> SendHandSize();
<a name="l00071"></a>00071 <span class="keywordtype">void</span> SendOfHandSizeComplete();
<a name="l00072"></a>00072 <span class="keywordtype">void</span> PrepareToSendCard();
<a name="l00073"></a>00073 <span class="keywordtype">void</span> AckSentAfterRecvWait(TInt aError);
<a name="l00074"></a>00074
<a name="l00075"></a>00075 <span class="keyword">protected</span>:
<a name="l00076"></a>00076 <a class="code" href="class_c_scabby_queen_player.html#17878fc131e45ace44be44b02881ff82">CScabbyQueenPlayer</a>(CConsoleBase& aConsole, RSocket& aSocket);
<a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_player.html#dd9fdc1316fce0f4060e71b9018aa4e3">ConstructL</a>();
<a name="l00078"></a>00078 <span class="keyword">private</span>:
<a name="l00079"></a>00079 <span class="comment">// Player send operation enumeration</span>
<a name="l00080"></a>00080 <span class="keyword">enum</span> TPlayerSendMode
<a name="l00081"></a>00081 {
<a name="l00082"></a>00082 ESendPlayerCard,
<a name="l00083"></a>00083 ESendReadyForUpdate,
<a name="l00084"></a>00084 ESendRecvTokenSuccess,
<a name="l00085"></a>00085 ESendCardRecvNotification,
<a name="l00086"></a>00086 ESendGameStatus,
<a name="l00087"></a>00087 ESendReadyForToken,
<a name="l00088"></a>00088 ESendCardNumber,
<a name="l00089"></a>00089 ESendOwnHandSize,
<a name="l00090"></a>00090 EPlayerSendAckSendCard,
<a name="l00091"></a>00091 EPlayerSendAckRecvHandSize,
<a name="l00092"></a>00092 EPlayerSendAckRecvCard,
<a name="l00093"></a>00093 EPlayerSendAckRecvWait
<a name="l00094"></a>00094 };
<a name="l00095"></a>00095 <span class="comment">// Player receive operation enumeration </span>
<a name="l00096"></a>00096 <span class="keyword">enum</span> TPlayerRecvMode
<a name="l00097"></a>00097 {
<a name="l00098"></a>00098 EPlayerRecvNum,
<a name="l00099"></a>00099 EPlayerRecvHand,
<a name="l00100"></a>00100 EPlayerRecvStatus,
<a name="l00101"></a>00101 EGameStatus,
<a name="l00102"></a>00102 EPlayerUpdate,
<a name="l00103"></a>00103 EDealerReady,
<a name="l00104"></a>00104 ERecvHandSize,
<a name="l00105"></a>00105 ERecvCardNum,
<a name="l00106"></a>00106 ERecvCard
<a name="l00107"></a>00107 };
<a name="l00108"></a>00108 CConsoleBase& iConsole;
<a name="l00109"></a>00109 <span class="comment">//TBuf8<KDeckBufferLength> iTempBuffer;</span>
<a name="l00110"></a>00110 TSockXfrLength iHandLength;
<a name="l00111"></a>00111 TPckgBuf<TInt> iSuccess;
<a name="l00112"></a>00112 TInt iCurrentStatus;
<a name="l00113"></a>00113 TBool iRecvTimerSet;
<a name="l00114"></a>00114 RBuf8 iCheckSize;
<a name="l00115"></a>00115 <span class="keyword">public</span>:
<a name="l00116"></a><a class="code" href="class_c_scabby_queen_player.html#5152449f35952211ad4b582d006e51b4">00116</a> TInt <a class="code" href="class_c_scabby_queen_player.html#5152449f35952211ad4b582d006e51b4">iResendCount</a>;
<a name="l00117"></a><a class="code" href="class_c_scabby_queen_player.html#d1a94cca6a1c4c9f13a9dfa3f05af186">00117</a> TBool <a class="code" href="class_c_scabby_queen_player.html#d1a94cca6a1c4c9f13a9dfa3f05af186">iGameOver</a>;
<a name="l00118"></a><a class="code" href="class_c_scabby_queen_player.html#fc6b5243adb9a806b7ec2f7761bd80db">00118</a> RBuf8 <a class="code" href="class_c_scabby_queen_player.html#fc6b5243adb9a806b7ec2f7761bd80db">iHand</a>;
<a name="l00119"></a><a class="code" href="class_c_scabby_queen_player.html#143868759802fb1069f34f0047286bb5">00119</a> TBool <a class="code" href="class_c_scabby_queen_player.html#143868759802fb1069f34f0047286bb5">iCurrentPlayer</a>;
<a name="l00120"></a><a class="code" href="class_c_scabby_queen_player.html#021d52f8661b9002ac2925c885706382">00120</a> TPckgBuf<TPlayerStatus> <a class="code" href="class_c_scabby_queen_player.html#021d52f8661b9002ac2925c885706382">iStatusBuffer</a>;
<a name="l00121"></a><a class="code" href="class_c_scabby_queen_player.html#bc2eb211fa36858944e369e252b6d599">00121</a> TPckgBuf<TGameStatus> <a class="code" href="class_c_scabby_queen_player.html#bc2eb211fa36858944e369e252b6d599">iGameStatus</a>;
<a name="l00122"></a><a class="code" href="class_c_scabby_queen_player.html#d10c8c7d9f8422e3db0e89ab73453f34">00122</a> TBool <a class="code" href="class_c_scabby_queen_player.html#d10c8c7d9f8422e3db0e89ab73453f34">iSendingPlayer</a>;
<a name="l00123"></a><a class="code" href="class_c_scabby_queen_player.html#f85e2a1941387c472cd8d3ac662fffcc">00123</a> TBool <a class="code" href="class_c_scabby_queen_player.html#f85e2a1941387c472cd8d3ac662fffcc">iFinished</a>;
<a name="l00124"></a><a class="code" href="class_c_scabby_queen_player.html#3baeb16aac0d5522265872d594f9c5c4">00124</a> TBuf8<KCardLength> <a class="code" href="class_c_scabby_queen_player.html#3baeb16aac0d5522265872d594f9c5c4">iReceivedCard</a>;
<a name="l00125"></a><a class="code" href="class_c_scabby_queen_player.html#3a34ad82e43147875e4eba59ad67f161">00125</a> TBuf8<20> <a class="code" href="class_c_scabby_queen_player.html#3a34ad82e43147875e4eba59ad67f161">iPlayerUpdate</a>;
<a name="l00126"></a>00126 <span class="comment">// TSockXfrLength iLengthOfUpdate;// To get the actual size of the update</span>
<a name="l00127"></a><a class="code" href="class_c_scabby_queen_player.html#a8b352f4b31775a4e7836facd1fc97d9">00127</a> TPlayerSendMode <a class="code" href="class_c_scabby_queen_player.html#a8b352f4b31775a4e7836facd1fc97d9">iSendMode</a>;
<a name="l00128"></a><a class="code" href="class_c_scabby_queen_player.html#4a9c025e9912b23f9cd601d6f0500a5d">00128</a> TPlayerRecvMode <a class="code" href="class_c_scabby_queen_player.html#4a9c025e9912b23f9cd601d6f0500a5d">iRecvMode</a>;
<a name="l00129"></a>00129
<a name="l00130"></a><a class="code" href="class_c_scabby_queen_player.html#a7585d174be28cbc1f675ed3e6aa85a5">00130</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_player.html#a7585d174be28cbc1f675ed3e6aa85a5">iPlayerNum</a>;
<a name="l00131"></a><a class="code" href="class_c_scabby_queen_player.html#db63461280911cf9d3416a6ed439137d">00131</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_player.html#db63461280911cf9d3416a6ed439137d">iUpdateSize</a>;
<a name="l00132"></a><a class="code" href="class_c_scabby_queen_player.html#e1e3f150539ca2cb233d3faba4c24b7f">00132</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_player.html#e1e3f150539ca2cb233d3faba4c24b7f">iPeerHandSize</a>;
<a name="l00133"></a><a class="code" href="class_c_scabby_queen_player.html#4cf11761ced1d870e735d92ec25e9f9e">00133</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_player.html#4cf11761ced1d870e735d92ec25e9f9e">iCardNum</a>;
<a name="l00134"></a><a class="code" href="class_c_scabby_queen_player.html#861583a8b670560f6c51b4958484bdd4">00134</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_player.html#861583a8b670560f6c51b4958484bdd4">iOwnHandSize</a>;
<a name="l00135"></a><a class="code" href="class_c_scabby_queen_player.html#9756b26cd420c6baff518e3df7d2e77e">00135</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_player.html#9756b26cd420c6baff518e3df7d2e77e">iAck</a>;
<a name="l00136"></a><a class="code" href="class_c_scabby_queen_player.html#6d8dc743f48ea0c0474d8fd2731016bc">00136</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_player.html#6d8dc743f48ea0c0474d8fd2731016bc">iGameOverBuffer</a>;
<a name="l00137"></a>00137
<a name="l00138"></a>00138 };
<a name="l00139"></a>00139
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <span class="preprocessor">#endif // PLAYER_H</span>
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:32:57 2010 for TB10.1 Example Applications by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>