|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
|
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
|
3 <title>TB10.1 Example Applications: examples/Bluetooth/BTExample1/inc/dealer.h Source File</title> |
|
4 <link href="doxygen.css" rel="stylesheet" type="text/css"> |
|
5 <link href="tabs.css" rel="stylesheet" type="text/css"> |
|
6 </head><body> |
|
7 <!-- Generated by Doxygen 1.5.3 --> |
|
8 <h1>examples/Bluetooth/BTExample1/inc/dealer.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> |
|
9 <a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span> |
|
10 <a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span> |
|
11 <a name="l00004"></a>00004 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span> |
|
12 <a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span> |
|
13 <a name="l00006"></a>00006 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span> |
|
14 <a name="l00007"></a>00007 <span class="comment">//</span> |
|
15 <a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span> |
|
16 <a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span> |
|
17 <a name="l00010"></a>00010 <span class="comment">//</span> |
|
18 <a name="l00011"></a>00011 <span class="comment">// Contributors:</span> |
|
19 <a name="l00012"></a>00012 <span class="comment">//</span> |
|
20 <a name="l00013"></a>00013 <span class="comment">// Description:</span> |
|
21 <a name="l00014"></a>00014 <span class="comment">//</span> |
|
22 <a name="l00015"></a>00015 |
|
23 <a name="l00016"></a>00016 <span class="preprocessor">#ifndef DEALER_H</span> |
|
24 <a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define DEALER_H</span> |
|
25 <a name="l00018"></a>00018 <span class="preprocessor"></span> |
|
26 <a name="l00019"></a>00019 |
|
27 <a name="l00020"></a>00020 <span class="preprocessor">#include <e32base.h></span> |
|
28 <a name="l00021"></a>00021 <span class="preprocessor">#include <in_sock.h></span> |
|
29 <a name="l00022"></a>00022 <span class="preprocessor">#include "gameconstants.h"</span> |
|
30 <a name="l00023"></a>00023 <span class="preprocessor">#include "cardgamedealer.h"</span> |
|
31 <a name="l00024"></a>00024 |
|
32 <a name="l00025"></a>00025 |
|
33 <a name="l00026"></a>00026 |
|
34 <a name="l00027"></a>00027 |
|
35 <a name="l00034"></a><a class="code" href="class_c_scabby_queen_dealer.html">00034</a> <span class="keyword">class </span><a class="code" href="class_c_scabby_queen_dealer.html">CScabbyQueenDealer</a> : <span class="keyword">public</span> <a class="code" href="class_c_card_game_dealer.html">CCardGameDealer</a> |
|
36 <a name="l00035"></a>00035 { |
|
37 <a name="l00036"></a>00036 <span class="keyword">public</span>: |
|
38 <a name="l00037"></a>00037 <span class="keyword">static</span> <a class="code" href="class_c_scabby_queen_dealer.html">CScabbyQueenDealer</a>* <a class="code" href="class_c_scabby_queen_dealer.html#5cd1d94de34db0f024de9731ba698940">NewL</a>(CConsoleBase& aConsole, |
|
39 <a name="l00038"></a>00038 RArray<TInetAddr>& aRemoteNames, |
|
40 <a name="l00039"></a>00039 RSocket& aSocket); |
|
41 <a name="l00040"></a>00040 <a class="code" href="class_c_scabby_queen_dealer.html#ed3319fef36c77963d3d774fb81f7335">~CScabbyQueenDealer</a>(); |
|
42 <a name="l00041"></a>00041 <span class="comment">// implementations of virtual functions here</span> |
|
43 <a name="l00042"></a>00042 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#01ff48386a2d56365c0722f057dbde90">SendComplete</a>(TInt aError); |
|
44 <a name="l00043"></a>00043 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#31ddcbf318bec20812aa7885cecbc003">RecvComplete</a>(TInetAddr aRecvAddr,TInt aError); |
|
45 <a name="l00044"></a>00044 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#275910f6a9dbaeb7ed79f907972d169b">TimerComplete</a>(); |
|
46 <a name="l00045"></a>00045 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#082666bc321d2209abb56fb5f4a3a2e1">StartTheGame</a>(); |
|
47 <a name="l00046"></a>00046 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#f6a709846dab42334309de80d8e15ffd">DealDeckL</a>(); |
|
48 <a name="l00047"></a>00047 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#7d2def26f1acaca85f07cc66f993e35c">ShowDeckL</a>(); |
|
49 <a name="l00048"></a>00048 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#bd6d72d867902a1ba3341a56b4cda461">SendPlayerNumbers</a>(); |
|
50 <a name="l00049"></a>00049 |
|
51 <a name="l00050"></a>00050 <span class="keyword">private</span>: |
|
52 <a name="l00051"></a>00051 <span class="keywordtype">void</span> InformReceivingPlayer(); |
|
53 <a name="l00052"></a>00052 <span class="keywordtype">void</span> InformSendingPlayer(); |
|
54 <a name="l00053"></a>00053 <span class="keywordtype">void</span> InformStaticPlayers(); |
|
55 <a name="l00054"></a>00054 <span class="keywordtype">void</span> RecvOfCardComplete(); |
|
56 <a name="l00055"></a>00055 <span class="keywordtype">void</span> RecvOfFinishNotify(); |
|
57 <a name="l00056"></a>00056 <span class="keywordtype">void</span> CheckPlayerStatus(); |
|
58 <a name="l00057"></a>00057 <span class="keywordtype">void</span> DealWithGameStatus(TGameStatus aGameStatus); |
|
59 <a name="l00058"></a>00058 <span class="keywordtype">void</span> RecvCard(); |
|
60 <a name="l00059"></a>00059 <span class="keywordtype">void</span> ReceivingPlayerInformed(TInt aError); |
|
61 <a name="l00060"></a>00060 <span class="keywordtype">void</span> StaticPlayersInformed(TInt aError); |
|
62 <a name="l00061"></a>00061 <span class="keywordtype">void</span> CardSent(); |
|
63 <a name="l00062"></a>00062 <span class="keywordtype">void</span> SendReadyInquiry(); |
|
64 <a name="l00063"></a>00063 <span class="keywordtype">void</span> SendPlayerUpdate(); |
|
65 <a name="l00064"></a>00064 <span class="keywordtype">void</span> PlayerUpdateSent(TInt aError); |
|
66 <a name="l00065"></a>00065 <span class="keywordtype">void</span> SendOfCheckStatusComplete(TInt aError); |
|
67 <a name="l00066"></a>00066 <span class="keywordtype">void</span> ReadyInquirySent(TInt aError); |
|
68 <a name="l00067"></a>00067 <span class="keywordtype">void</span> DealWithStatusFromRecv(); |
|
69 <a name="l00068"></a>00068 <span class="keywordtype">void</span> DealWithStatusFromSender(); |
|
70 <a name="l00069"></a>00069 <span class="keywordtype">void</span> ReceiveCardNum(); |
|
71 <a name="l00070"></a>00070 <span class="keywordtype">void</span> SendHandSize(); |
|
72 <a name="l00071"></a>00071 <span class="keywordtype">void</span> SendCardNumber(); |
|
73 <a name="l00072"></a>00072 <span class="keywordtype">void</span> RecvHandSize(TInt aError); |
|
74 <a name="l00073"></a>00073 <span class="keywordtype">void</span> SendCompleted(TInt aError); |
|
75 <a name="l00074"></a>00074 <span class="keywordtype">void</span> RecvOfAckComplete(); |
|
76 <a name="l00075"></a>00075 <span class="keywordtype">void</span> TimerCompleted(); |
|
77 <a name="l00076"></a>00076 <span class="keywordtype">void</span> SentGameOverMessage(); |
|
78 <a name="l00077"></a>00077 <span class="keywordtype">void</span> InformNextGameOver(); |
|
79 <a name="l00078"></a>00078 <span class="keywordtype">void</span> InformStaticPlayersProcess(); |
|
80 <a name="l00079"></a>00079 |
|
81 <a name="l00080"></a>00080 |
|
82 <a name="l00081"></a>00081 |
|
83 <a name="l00082"></a>00082 <span class="keyword">protected</span>: |
|
84 <a name="l00083"></a>00083 <a class="code" href="class_c_scabby_queen_dealer.html#e0d5a3d2cda4e83234febb9f5123ea1a">CScabbyQueenDealer</a>(CConsoleBase& aConsole, RArray<TInetAddr>& aRemoteNames, RSocket& aSocket); |
|
85 <a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="class_c_scabby_queen_dealer.html#2df9ed4625d55297f125c09e99a3a100">ConstructL</a>(); |
|
86 <a name="l00085"></a>00085 |
|
87 <a name="l00086"></a>00086 <span class="keyword">public</span>: |
|
88 <a name="l00087"></a><a class="code" href="class_c_scabby_queen_dealer.html#09bd3d6ad102d2e9a73093b1e45bb1b2">00087</a> TBool <a class="code" href="class_c_scabby_queen_dealer.html#09bd3d6ad102d2e9a73093b1e45bb1b2">iGameOver</a>; |
|
89 <a name="l00088"></a><a class="code" href="class_c_scabby_queen_dealer.html#4b9b1dc995ea3e246f6ed013040069fe">00088</a> TPckgBuf<TGameStatus> <a class="code" href="class_c_scabby_queen_dealer.html#4b9b1dc995ea3e246f6ed013040069fe">iGameStatus</a>; |
|
90 <a name="l00089"></a><a class="code" href="class_c_scabby_queen_dealer.html#f07a255ee12a7cacfd8bf4ffe1bdba17">00089</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#f07a255ee12a7cacfd8bf4ffe1bdba17">iPlayerNum</a>; |
|
91 <a name="l00090"></a><a class="code" href="class_c_scabby_queen_dealer.html#f6a705f53acad1af90c477874ec7b4fc">00090</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#f6a705f53acad1af90c477874ec7b4fc">iCount</a>; |
|
92 <a name="l00091"></a><a class="code" href="class_c_scabby_queen_dealer.html#d36b0a19783d42bd2eb4007743bac8b8">00091</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#d36b0a19783d42bd2eb4007743bac8b8">iPlayerToken</a>; |
|
93 <a name="l00092"></a><a class="code" href="class_c_scabby_queen_dealer.html#ab4cab071db2acc68397fa0bb8caa93b">00092</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#ab4cab071db2acc68397fa0bb8caa93b">iSender</a>; |
|
94 <a name="l00093"></a><a class="code" href="class_c_scabby_queen_dealer.html#5cb6915fc79735c3809baf7bb1f08066">00093</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#5cb6915fc79735c3809baf7bb1f08066">iPlayerCount</a>; |
|
95 <a name="l00094"></a><a class="code" href="class_c_scabby_queen_dealer.html#9c32bcbffbfaf85ba7d765d97b1be24a">00094</a> TInt <a class="code" href="class_c_scabby_queen_dealer.html#9c32bcbffbfaf85ba7d765d97b1be24a">iResendCount</a>; |
|
96 <a name="l00095"></a><a class="code" href="class_c_scabby_queen_dealer.html#2ced907d15f1ce37473ffcb150e64d8b">00095</a> TBuf8<20> <a class="code" href="class_c_scabby_queen_dealer.html#2ced907d15f1ce37473ffcb150e64d8b">iPlayerUpdate</a>; |
|
97 <a name="l00096"></a><a class="code" href="class_c_scabby_queen_dealer.html#5904bca399ce397edfccc42657894e42">00096</a> TBuf8<20> <a class="code" href="class_c_scabby_queen_dealer.html#5904bca399ce397edfccc42657894e42">iOldPlayerUpdate</a>; |
|
98 <a name="l00097"></a><a class="code" href="class_c_scabby_queen_dealer.html#885b64499cf7eb2417146c203ffe2dde">00097</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#885b64499cf7eb2417146c203ffe2dde">iUpdateSize</a>; |
|
99 <a name="l00098"></a><a class="code" href="class_c_scabby_queen_dealer.html#9cfe6dd0f07eb447099d83717064b21e">00098</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#9cfe6dd0f07eb447099d83717064b21e">iSenderHandSize</a>; |
|
100 <a name="l00099"></a><a class="code" href="class_c_scabby_queen_dealer.html#d2fda83bc39115599e045ada314bf3c7">00099</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#d2fda83bc39115599e045ada314bf3c7">iCardNum</a>; |
|
101 <a name="l00100"></a><a class="code" href="class_c_scabby_queen_dealer.html#cdd5b112e0d93246b784fcc979e300a5">00100</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#cdd5b112e0d93246b784fcc979e300a5">iAck</a>; |
|
102 <a name="l00101"></a><a class="code" href="class_c_scabby_queen_dealer.html#d5cf6b60e28be5717dbf448c811e25f8">00101</a> TPckgBuf<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#d5cf6b60e28be5717dbf448c811e25f8">iGameOverBuffer</a>; |
|
103 <a name="l00102"></a><a class="code" href="class_c_scabby_queen_dealer.html#261bd4bcd5a2fb03c8a2bdccd7f8545d">00102</a> RArray<TInt> <a class="code" href="class_c_scabby_queen_dealer.html#261bd4bcd5a2fb03c8a2bdccd7f8545d">iLostPlayers</a>; |
|
104 <a name="l00103"></a>00103 |
|
105 <a name="l00104"></a>00104 <span class="keyword">private</span>: |
|
106 <a name="l00105"></a>00105 <span class="comment">// Dealer send operation enumeration </span> |
|
107 <a name="l00106"></a>00106 <span class="keyword">enum</span> TDealerSendMode |
|
108 <a name="l00107"></a>00107 { |
|
109 <a name="l00108"></a>00108 ESendPlayerNum, |
|
110 <a name="l00109"></a>00109 ESendRecvToken, |
|
111 <a name="l00110"></a>00110 ESendSendToken, |
|
112 <a name="l00111"></a>00111 ESendWaitToken, |
|
113 <a name="l00112"></a>00112 ESendCard, |
|
114 <a name="l00113"></a>00113 ESendCheckRecvStatus, |
|
115 <a name="l00114"></a>00114 ESendCheckSenderStatus, |
|
116 <a name="l00115"></a>00115 ESendReadyInquiry, |
|
117 <a name="l00116"></a>00116 ESendPlayerUpdate, |
|
118 <a name="l00117"></a>00117 ESendHandSize, |
|
119 <a name="l00118"></a>00118 ESendPlayerCardNumber, |
|
120 <a name="l00119"></a>00119 ESendGameOver |
|
121 <a name="l00120"></a>00120 }; |
|
122 <a name="l00121"></a>00121 <span class="comment">// Dealer receive operation enumeration </span> |
|
123 <a name="l00122"></a>00122 <span class="keyword">enum</span> TDealerRecvMode |
|
124 <a name="l00123"></a>00123 { |
|
125 <a name="l00124"></a>00124 ERecvSuccess, |
|
126 <a name="l00125"></a>00125 ERecvCardNotification, |
|
127 <a name="l00126"></a>00126 EDealerRecvCard, |
|
128 <a name="l00127"></a>00127 ERecvStatusRecv, |
|
129 <a name="l00128"></a>00128 ERecvStatusSender, |
|
130 <a name="l00129"></a>00129 ERecvReadyResult, |
|
131 <a name="l00130"></a>00130 ERecvUpdateResult, |
|
132 <a name="l00131"></a>00131 EDealerRecvHandSize, |
|
133 <a name="l00132"></a>00132 EDealerRecvCardNum, |
|
134 <a name="l00133"></a>00133 EDealerRecvAck |
|
135 <a name="l00134"></a>00134 }; |
|
136 <a name="l00135"></a>00135 |
|
137 <a name="l00136"></a>00136 CConsoleBase& iConsole; |
|
138 <a name="l00137"></a>00137 TDealerRecvMode iRecvMode; |
|
139 <a name="l00138"></a>00138 TDealerSendMode iSendMode; |
|
140 <a name="l00139"></a>00139 HBufC8* iFullDeck; |
|
141 <a name="l00140"></a>00140 RBuf8 iCheckSize; |
|
142 <a name="l00141"></a>00141 TUint iRandom; |
|
143 <a name="l00142"></a>00142 TBuf8<KDeckBufferLength> iTempBuffer; |
|
144 <a name="l00143"></a>00143 TPckgBuf<TPlayerStatus> iStatusBuffer; |
|
145 <a name="l00144"></a>00144 TPckgBuf<TInt> iSuccess; |
|
146 <a name="l00145"></a>00145 |
|
147 <a name="l00146"></a>00146 TInetAddr iSenderAddr; |
|
148 <a name="l00147"></a>00147 RArray<TInt> iFinishedPlayers; |
|
149 <a name="l00148"></a>00148 RArray<TInt> iCurrentPlayers; |
|
150 <a name="l00149"></a>00149 TInt iResponseCount; |
|
151 <a name="l00150"></a>00150 TInt iWaitingPlayerCount; |
|
152 <a name="l00151"></a>00151 TBuf8<KCardLength> iReceivedCard; |
|
153 <a name="l00152"></a>00152 }; |
|
154 <a name="l00153"></a>00153 |
|
155 <a name="l00154"></a>00154 |
|
156 <a name="l00155"></a>00155 <span class="preprocessor">#endif // DEALER_H</span> |
|
157 </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 |
|
158 <a href="http://www.doxygen.org/index.html"> |
|
159 <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address> |
|
160 </body> |
|
161 </html> |