src/Card.c
[NalaBridge.git] / src / Game.c
blobc3a8dd3fe95d0e5a1aef86a87cae8df3edb21988
1 /***************************************************************************
2 * Copyright (C) 2008 by NalaGinrut *
3 * suimualatsuki@163.com *
4 * *
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. *
9 * *
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. *
14 * *
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 ***************************************************************************/
21 /*!
22 \file Game.c
23 \brief °üº¬GameÀàµÄËùÓз½·¨
26 #include "Game.h"
27 #include "COO.h"
28 #include "GameCtr.h"
29 #include "Player.h"
31 //¹¹Ô캯ÊýÌ壻
33 /**
34 \var GameData
35 \brief È«¾Ö¿ØÖƱäÁ¿
37 global_data GameData;
39 /**
40 *\fn void GameClass(GameClass *g)
41 \brief ThisGameµÄ¹¹Ô캯Êý
42 \param g
43 \brief GameClassÖ¸ÕëÀàÐÍ
44 \n ÓÃÀ´³õʼ»¯GameClassÀàÐÍ
46 void GameClass(game *g)
48 puts("Init This Game...");
50 GameInit(g);
52 //TODO
55 /**
56 * \fn int GameBid()
57 * @return Õý³£ÎªOK£¬Ò쳣ΪERROR
58 \brief Ò»´Î½ÐÅƹý³Ì
59 \n Õû¸ö½ÐÅƹý³Ì£¬×¢ÒâÔÚÍ˳öµÄʱºòÒª½«end_voteÖØÐÂÖÃ0£¬ÒÔ¹©GameʹÓã»
61 int GameBid()
63 puts("Game Bid");
64 //TODO
65 //GameData.end_vote=Begin;
68 /**
69 * \fn int GamePlay()
70 * @return Õý³£ÎªOK£¬Ò쳣ΪERROR
71 \brief Ò»´Î³öÅƹý³Ì
73 int GamePlay()
75 puts("Game Play");
76 //TODO
79 /**
80 * \fn int GameRefresh()
81 * @return Õý³£ÎªOK£¬Ò쳣ΪERROR
82 \brief Ò»´ÎÊý¾ÝˢУ¬½«GameÀàµÄÊý¾Ý´æÈëÈ«¾ÖÊý¾ÝGlobalData
84 int GameRefresh()
86 puts("Game Refresh");
88 //TODO
91 /**
92 * \fn int GameJoin(PlayerList,player)
93 * @return Õý³£ÎªOK£¬Ò쳣ΪFULL
94 \brief ¼ÓÈëÍæ¼Ò£¬Èç¹ûÂúÁ˾ͷµ»ØFULL£¬¸ù¾ÝGameClassÖеÄEmptyÀ´ÅжÏÊÇ·ñÓпÕȱ²¢¼ÓÈë
95 \param game
96 \brief Òª¼ÓÈëµÄÓÎÏ·
97 \param player
98 \brief Òª¼ÓÈëµÄÍæ¼Ò
100 int GameJoin(game *g,player *p)
102 if (g->run.isfull())
103 return Full;
105 //puts("Player %s join OK!",GameData.playname[GameData.empty]);
106 //TODO:p join g;
107 return OK;
112 * \fn int GameIsFull()
113 * @return TRUE or FALSE
114 \brief ¸ù¾ÝemptyÅжÏÊÇ·ñÓпÕȱÍæ¼Ò
116 int GameIsFull()
118 //TODO;
119 return TRUE;
123 * \fn int NoEnd()
124 * @return ¹ý³Ì½áÊøΪTRUE£¬¹ý³Ì¼ÌÐøΪFalse£»
125 \brief ÅжϹý³ÌÊÇ·ñ½áÊø£¬°üÀ¨ÓÎÏ·¹ý³Ì ºÍ ½ÐÅƹý³Ì
127 int NoEnd()
129 if ( !IsEqu(GameData.end_vote,EndGame) )
130 return TRUE;
131 return FALSE;