1 /***************************************************************************
2 * Copyright (C) 2008 by NalaGinrut *
3 * suimualatsuki@163.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
23 \brief °üº¬Game¿ØÖƵÄËùÓк¯Êý
41 extern global_data GameData;
45 * @return ERROR number
51 C_Class GameClass g=NewClass(GameClass,g);
52 C_Class PlayerClass west=NewClass(PlayerClass,west);
53 C_Class PlayerClass north=NewClass(PlayerClass,north);
54 C_Class PlayerClass east=NewClass(PlayerClass,east);
55 C_Class PlayerClass south=NewClass(PlayerClass,south);
58 GameData.current=west;//FIXME:×¢Ò⿼ÂÇÈçºÎ½«¿ØÖÆȨ½»¸øµ±Ç°Íæ¼Ò£¬ÊDZ¾³ÌÐòCOOʵÏֵĹؼüÖ®ËùÔÚ£»
59 //FIXME:Ä¿Ç°»¹ÓдýÍêÉÆ£»*/
61 assert(g.run.bid!=NULL);
63 printf("g.run.noend()=%d\n",g.run.noend());
65 while (g.run.noend()==TRUE)
69 GameData.end_vote++;//ʵ¼ÊÉÏGameDataÔÚ±à³ÌÖв»¿É¼û£¬ÒªÍ¨¹ý·½·¨À´ÉèÖÃËü£¬´Ë´¦Ö»ÊÇʾÀý£»
79 * \fn int GameRestart()
80 * @return ERROR number
82 \n ÓÎÏ·ÖØÐÂÆô¶¯£¬Ð¿ªÒ»¾ÖÓÎÏ·
89 * @return ERROR number
97 * \fn int GameScoreDisplay()
98 * @return ERROR number
100 \n ÏÔʾµ½Ä¿Ç°ÎªÖ¹ÓÎÏ·½ø¶È¸÷¸öÍæ¼ÒµÄ·ÖÊý
102 int GameScoreDisplay()
107 * @return ERROR number
108 \brief ÅжÏÒ»¾ÖÓÎÏ·ÊÇ·ñ½áÊø
109 \n ͨ¹ýÅжÏÍæ¼ÒµÄ Íê½áͶƱ À´¾ö¶¨ÊÇ·ñ½áÊøÒ»¾ÖÓÎÏ·
110 \n ͨ³£Èç¹û½áÊøµÄ»°Òâζ×Å£º(1)ÅÆÒѾ³öÍê¡¢(2)½ÐÅÆÍê³É¡¢(3)ËùÓÐÍæ¼Òͨ¹ýʤÀûÐûÑÔ
114 return IsEqu(GameData.no_quit,NO);
118 * \fn int GameInit(game *g)
120 * @return ERROR number
121 \brief ³õʼ»¯ÓÎÏ·Êý¾Ý
122 \n ½«ÓÎÏ·Àà¡¢Íæ¼ÒÀàµÄÊý¾Ý³õʼ»¯
124 int GameInit(game *g)
129 SetData(g->trump ,South);
130 SetData(g->end_vote ,Begin);
131 //SetData(g->bid_order,Init);
132 //SetData(g->bid_list,Init);
134 //´Ë´¦ÐèÒª¸Ä½ø£¬¹ØÓÚÊý¾ÝÀàÐ͵Ä×Ô¶¯Ê¶±ð¼°³õʼ»¯£»
136 SetData(g->play_order ,Init);
137 SetData(g->NS_score ,Init);
138 SetData(g->EW_score ,Init);
140 SetFunc(g->run.bid ,GameBid);
141 SetFunc(g->run.play ,GamePlay);
142 SetFunc(g->run.refresh ,GameRefresh);
143 SetFunc(g->run.noend ,NoEnd);
144 SetFunc(g->run.isfull ,GameIsFull);
145 SetFunc(g->run.join ,GameJoin);