/[maitretarot]/game_server/src/state_machine.c
ViewVC logotype

Diff of /game_server/src/state_machine.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by ymettier, Tue Jun 10 22:01:26 2003 UTC revision 1.11 by ymettier, Thu Jul 10 13:22:44 2003 UTC
# Line 145  game_state_machine_cb (gpointer a, gpoin Line 145  game_state_machine_cb (gpointer a, gpoin
145      }      }
146    else if (g->state == GAME_STATE_CHIEN_MANAGMENT)    else if (g->state == GAME_STATE_CHIEN_MANAGMENT)
147      {      {
148              /* Some code was written the day after my Grand'ma died.        /* Some code was written the day after my Grand'ma died.
149               * I dedicate that code to her.         * I dedicate that code to her.
150               * I, her and my Grand'pa spent hours and hours playing Tarot         * I, her and my Grand'pa spent hours and hours playing Tarot
151               * Please do not remove this comment         * Please do not remove this comment
152               * Yves (June 6th 2003)         * Yves (June 6th 2003)
153               */         */
154        if ((LIBMT_BID_CMP (g->rules->bid, LIBMT_BID_PRISE))        if ((LIBMT_BID_CMP (g->rules->bid, LIBMT_BID_PRISE))
155            && (LIBMT_BID_CMP (g->rules->bid, LIBMT_BID_GARDE)))            && (LIBMT_BID_CMP (g->rules->bid, LIBMT_BID_GARDE)))
156          {          {
# Line 160  game_state_machine_cb (gpointer a, gpoin Line 160  game_state_machine_cb (gpointer a, gpoin
160          {          {
161            int s1;            int s1;
162            player_t *p1;            player_t *p1;
163              int nb = 0;
164              int pos;
165            for (i = 0; i < g->players->len; i++)            for (i = 0; i < g->players->len; i++)
166              {              {
167                s1 = g_array_index (g->players, int, i);                s1 = g_array_index (g->players, int, i);
# Line 170  game_state_machine_cb (gpointer a, gpoin Line 172  game_state_machine_cb (gpointer a, gpoin
172            s1 = g_array_index (g->players, int, g->rules->preneur);            s1 = g_array_index (g->players, int, g->rules->preneur);
173            p1 = g_tree_lookup (config->sock_id, GINT_TO_POINTER (s1));            p1 = g_tree_lookup (config->sock_id, GINT_TO_POINTER (s1));
174            g_assert (p1 != NULL);            g_assert (p1 != NULL);
175              if (g->nb_players_max == 3)
176                nb = 6;
177              else if (g->nb_players_max == 4)
178                nb = 6;
179              else if (g->nb_players_max == 5)
180                nb = 3;
181              g_assert (nb != 0);
182              pos = player_get_position (p1);
183              for (i = 0; i < nb; i++)
184                {
185                  g->rules->card_status[g->rules->chien[i]] = pos;
186                }
187            send_ask_chien (s1, p1);            send_ask_chien (s1, p1);
188            g->state = GAME_STATE_ASKING_CHIEN;            g->state = GAME_STATE_ASKING_CHIEN;
189          }          }
190      }      }
191    else if (g->state == GAME_STATE_ASKING_CHIEN)    else if (g->state == GAME_STATE_ASKING_CHIEN)
192      {      {
193    /* Nothing to do here but maybe some timeout job ? */
194        }
195      else if (g->state == GAME_STATE_ASKING_CHIEN_DONE)
196        {
197          g->state = GAME_STATE_PLAYING_GAME;
198      }      }
199    else if (g->state == GAME_STATE_PLAYING_GAME)    else if (g->state == GAME_STATE_PLAYING_GAME)
200      {      {

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26