Main Page   Alphabetical List   Data Structures   File List   Globals  

white.c File Reference

This file is run by VCC when the simulation is commenced. It is the main of the core module. More...

#include "white_interface.h"
#include <start_piece.h>
#include <piece.h>
#include <battlefield_piece.h>
#include "start_core.h"
#include "battle_core.h"
#include "start_core.c"
#include "battle_functions.c"

Defines

#define TRUE   1
#define FALSE   0

Functions

int vccPrintPdxDebugInfo (const char *format,...)
 Function used for debugging. More...

int strcmp (const char *s1, const char *s2)
 Compare two strings. More...

int abs (int a)
 Get absolute value of parameter. More...

void poin_entry_Init ()
 Function called upon starting the simulation. More...

void poin_entry_Begin ()
 Main Function of core module. More...


Variables

int battle_started
int player_no
int turn


Detailed Description

This file is run by VCC when the simulation is commenced. It is the main of the core module.

white.c is the equivalent of a main function in ANSI C. It has two main functions namely, poin_entry_Init() and poin_entry_Run()

The implementation of the game rules starts in this file. This is the basic implemenation of the module.
All functions and data structures in other files are referenced from here. When receiving an input from other modules
this file is run. The ports are checked to see if they are enabled. If a port is enabled, the code is executed and
the appropriate output signals are sent, either to bluetooth or to the graphics module. The white_interface.h file
describes the ports and functions used, which are declared automaticaly by VCC.

Inputs to the module are a move and a button. Outputs consist of a draw , a printSting to the graphics section, a Move and a button to bluetooth


Define Documentation

#define FALSE   0
 

Variable that translates the boolean known value FALSE to an integer 0.

#define TRUE   1
 

Variable that translates the boolean known value TRUE to an integer 1.


Function Documentation

int abs int    a
 

Get absolute value of parameter.

Function that gets the absolute value of a number. Used to translate the negative coordinates received
during initialisation from the input module to positive ones that allow me to reference the start array

void poin_entry_Begin  
 

Main Function of core module.

This is the "driving force" of each core module. Inside this module, we can find the basic data flow and functionality of the game.
There are two posible signals sent. A button and a Move.

MOVE

Upon receiving a move command from either the input module or bluetooth, we firstly check the source of the command. This can be:

  • The player himself
  • The opponent
NOTE: The observer (being an observer) is not permitted to send a command (i.e. make a move or press buttons). His
signals are ignored by the core module and therefore not sent to the network.

Then we compare the source of the command against the player identification of the module, which is the
variable player_no. The outcome is:

  • The message was sent and received by the player himself (i.e. the user tried to make a move)

    In this case, we firsty check whether the player is in the initialisation phase or if the battle has started. This
    can be detected by the variable battle_started.

    If we are at the initialisation phase, we firstly check if the third variable of the Move command is negative.
    A negative value represents that the user picked a piece from the bottom of the board. If that piece was available (not
    all kinds of its piece were already placed i.e. not all Marshals), then we check where he placed it.Therefore we
    check if the piece of the board that he placed it on, was free and if it was on the correct side of the board.
    The reader is reminded that one player places his pieces on the top part of the board and the other on the bottom.
    When all pieces have been placed, the user can press the "start" button to commence the game.

    If the game has already started and a Move command is received, coming from the player himself, the order of action is different:
    In this case the move is firstly verified against the game rules and if it is valid the
    battlefield array is updated and the appropriate signals are sent to the graphics and bluetooth section.
    The outcome of the command is determined by if it was an attack or not.

    • No Attack/Move:
      If we had a valid move then make the departing piece empty and fill in the destination piece accordingly.
      Then send a Move command down to bluetooth and two draw commands to graphics.
      i.e. Move(1,2,3,4,5): If battlefield[2][3] -> battlefield[4][5] is a valid move then make battlefield[2][3] empty
      and fill in battlefield[4][5] with what was in battlefield[2][3]. This action makes a move. Then send the
      appropriate draw commands to the Graphics module,to make battlefield[2][3] empty and battlefield[4][5] to have a piece.

    • Attack:
      The outcome of the attack is determined by the decide_winner function.
      This can be either the attacking player winning, losing or a draw.
      1. If the player wins, then his piece should be moved where the defending piece was.
      2. If he loses then his piece should become empty.
      3. If we have a draw then both pieces should be cleared.


    No matter which part of the game we are on (initialisation or if the battle has started) if we have a valid move,
    then it is necessary to send the appropriate Move message to the network. This is because the other player and observers
    should be aware of the action taken and update their Graphics section and core modeule data structures appropriately,
    so that their data are kept up to date.
  • The message was sent from the opponent and received by the other player. (i.e. the opponent made a move)

    In this case we firstly check if it is the initialisation phase or if the game has started.
    If it is the initialisation phase then we place a covered piece in the coordinates where the move was made.
    If the game has started then we determine if the piece moved by the opponent can be revealed or if it should remain
    covered. Furthermore we check to see if there was an attack and it was a draw, in which case we have to clear both pieces from the board.

    As described above, it is important for the data structures in the core section to have the adequate information,
    to decide whether the opponent's piece being moved should be displayed or not on its board. This depends on whether
    that specific piece has previously participated in a battle or not. This information should be kept in the
    battlefield array of the module.
    Whether it will be displayed, is determined by the "revealed" field in the piece composite. For a more detailed
    description of this field click on any piece word.

  • The message was received by the observer.(i.e. one of the players made a move)

    In this case the observer has to check if it the result of an attack was a draw, in which case he has to clear both pieces from his board. If it was not a draw
    he simply processes the move command and sends the appropriate draw commands to the graphics module. The observer can
    see both player's pieces and no piece is covered.
    It should be noted that the observer can not send a move command or press a button.

    BUTTON

    In Startego2Go buttons are used for communication and for control. At the start of the game, a button command is sent
    from the input module identifying each player to the core.This is explained in the poin_entry_Init() function.
    From there on, in the game console the user can see 2 buttons, namely the start button and the quit button.
    During the initialisation of the game, if the start button is pressed the core checks if all the pieces have been placed
    on the board. If they have the battle_started variable is set to TRUE and the game starts. If not a message is sent
    explaining that only when all pieces are placed can the game commence. The quit button is used if the user wants to quit the game.
    Again the observer can not press a button. The only reason for using the button structure is for identification at the start of the game

    The result of the attack action is detailed in the decide_winner function in battle_functions.c.
    The code for the poin_entry_Run function is displayed below with the C comments inside explaining in more detail what the program does.

00247                        {
00248 
00249 
00250         int i , temp_y1 , tmp;
00251         int k;
00252         move result;
00253         DrawSprite draw;
00254         PrintString out;
00255         char print_out[100];
00256         button pressed;
00257         start_piece f;
00258         char *tmpString;
00259         
00260 while(TRUE)
00261 {
00262 
00263 
00264         vccAwait();
00265 
00266 
00267         if (move_in_Enabled()){
00268                 result = *move_in_Value();
00269           if (player_no != 2){
00270                 if (battle_started == FALSE){  /* we are in initialisation phase */
00271                   if (player_no == result.player){
00272 
00273                         if (result.y1 > 0){
00274                                 /* sprintf(print_out, "You must complete placement before starting to move pieces around"); */
00275                                 vccPrintPdxDebugInfo("You must complete placement before starting to move pieces around\n");
00276                                 out.text = "PLACE@ALL"; out.x = 0; out.y = 6;
00277                                 print_Post(&out);
00278                                 vccAwait(10.0);
00279                                 for (k=0; k<10; k++){
00280                                         draw.bitmapno = 13;
00281                                         draw.x = k;
00282                                         draw.y = 6;
00283                                         draw_Post(&draw);
00284                                         vccAwait(10.0);
00285                                         }
00286                         }
00287 
00288                                 /* if placement process. */
00289                  if (result.y1 < 0){
00290                                 
00291                                 temp_y1 = abs(result.y1); /* make y positive... */
00292         
00293                                 if (start[result.x1][temp_y1].remaining == 0){
00294                                         vccPrintPdxDebugInfo("You have already placed all %s on battlefield\n",start[result.x1][temp_y1].name); 
00295                                         out.text = "ALL@PLACED"; out.x = 0; out.y = 6;
00296                                         print_Post(&out);
00297                                         vccAwait(10.0);
00298                                         for (k=0; k<10; k++){
00299                                         draw.bitmapno = 13;
00300                                         draw.x = k; draw.y = 6;
00301                                         draw_Post(&draw);
00302                                         vccAwait(10.0);
00303                                         }
00304                                 } else if ( check_placement(player_no , result.y2) ){
00305                                                 if (battlefield[result.x2][result.y2].player == -1){
00306                                                         start[result.x1][temp_y1].remaining--;
00307                 
00308                                                         update_battlefield( start[result.x1][temp_y1].name , result.player , result.x2 , result.y2);
00309 
00310                                                         vccPrintPdxDebugInfo("A %s was placed on the battlefield\n",battlefield[result.x2][result.y2].occupied.name);
00311                                                         draw.bitmapno = get_bitmapno(start[result.x1][temp_y1].name); 
00312                                                         draw.x = result.x2; draw.y = result.y2;
00313                                                         draw_Post(&draw);
00314 
00315                                                         move_out_Post(&result);
00316 
00317                                                 } else {
00318                                                         vccPrintPdxDebugInfo("The square on the battlefield has already been used\n");
00319                                                         out.text = "OCCUPIED"; out.x = 0; out.y = 6;
00320                                                         print_Post(&out);
00321                                                         vccAwait(10.0);
00322                                                         for (k=0; k<10; k++){
00323                                                                 draw.bitmapno = 13;
00324                                                                 draw.x = k; draw.y = 6;
00325                                                                 draw_Post(&draw);
00326                                                                 vccAwait(10.0);
00327                                                         }
00328                                                 }
00329                                 } else {/* else if */
00330                                         out.text = "AT@YOUR@END";
00331                                         out.x = 0; out.y = 6;
00332                                         print_Post(&out);
00333                                         vccAwait(10.0);
00334                                         for (k=0; k<10; k++){
00335                                                 draw.bitmapno = 13;
00336                                                 draw.x = k; draw.y = 6;
00337                                                 draw_Post(&draw);
00338                                                 vccAwait(10.0);
00339                                                 }
00340                                 } /* else */
00341                         } /* if (result.y1 <= 0) */
00342                   } else { /* if player_no == result.player */
00343                                         
00344                                 temp_y1 = abs(result.y1);
00345                                 update_battlefield( start[result.x1][temp_y1].name , result.player , result.x2 , result.y2);
00346 
00347                                 draw.bitmapno = 12; /* opponent draws a covered piece */
00348                                 draw.x = result.x2; draw.y = result.y2;
00349                                 draw_Post(&draw);
00350                         } /* else */
00351                 } else if (battle_started == TRUE){ 
00352                  if (player_no == result.player){
00353                   if (turn == 1){       
00354                         if (check_piece_clicked(result.player , result.x1 , result.y1 , result.x2 , result.y2)){
00355                                 if (attack_or_move(result.x2 , result.y2)){ /* if he attacked */
00356                                         vccPrintPdxDebugInfo("%s attacking piece in [%d][%d] which is a %s\n",battlefield[result.x1][result.y1].occupied.name,result.x2,result.y2,battlefield[result.x2][result.y2].occupied.name);
00357                                         if (decide_winner(result.x1 , result.y1 , result.x2 , result.y2) == 1){ /* if piece in x1,y1 stronger */
00358                                                 vccPrintPdxDebugInfo("[%d][%d] won %s\n",result.x1,result.y1,battlefield[result.x1][result.y1].occupied.name);
00359                                                 draw.bitmapno = get_bitmapno(battlefield[result.x1][result.y1].occupied.name); 
00360                                                 draw.x = result.x2; draw.y = result.y2;
00361                                                 draw_Post(&draw);
00362                                                 
00363                                                 vccAwait(5.0);
00364                                                         
00365                                                 draw.bitmapno = 13;
00366                                                 draw.x = result.x1; draw.y = result.y1;
00367                                                 draw_Post(&draw);
00368 
00369                                                 perform_move(player_no , result.x1 , result.y1 , result.x2 , result.y2 , 1);
00370                                                 turn = 0;                       
00371 
00372                                                 move_out_Post(&result);
00373                                                 vccPrintPdxDebugInfo("%s piece in [%d][%d] is the winner\n",battlefield[result.x2][result.y2].occupied.name,result.x1,result.y1);
00374                                         } else if (decide_winner(result.x1 , result.y1 , result.x2 , result.y2) == 2){ /* piece in x2,y2 stronger */
00375                                                 /* make piece empty     */
00376                                                 battlefield[result.x1][result.y1].occupied.name = "UNOCCUPIED";
00377                                                 battlefield[result.x1][result.y1].occupied.rank = -1;
00378                                                 battlefield[result.x1][result.y1].occupied.revealed = -1;
00379                                                 battlefield[result.x1][result.y1].player = -1;
00380         
00381                                                 /* clear attacking piece */
00382                                                 draw.bitmapno = 13;
00383                                                 draw.x = result.x1; draw.y = result.y1;
00384                                                 draw_Post(&draw);
00385 
00386                                                 /* also set winning piece's reveal flag to on */
00387                                                 battlefield[result.x2][result.y2].occupied.revealed == 1;
00388 
00389                                                 turn = 0; 
00390                                                 result.x2 = result.x1; result.y2 = result.y1; /* delete x1 , y1 piece */
00391                                                 move_out_Post(&result);
00392                                                 vccPrintPdxDebugInfo("%s piece in [%d][%d] is the winner\n",battlefield[result.x2][result.y2].occupied.name,result.x2,result.y2);
00393                                         } else if (decide_winner(result.x1 , result.y1 , result.x2 , result.y2) == 3){
00394                                                 vccPrintPdxDebugInfo("%s and %s have equal rank. Both lose!\n",battlefield[result.x1][result.y1].occupied.name,battlefield[result.x2][result.y2].occupied.name);
00395 
00396                                                 /* make piece empty     */
00397                                                 battlefield[result.x2][result.y2].occupied.name = "UNOCCUPIED";
00398                                                 battlefield[result.x2][result.y2].occupied.rank = -1;
00399                                                 battlefield[result.x2][result.y2].occupied.revealed = -1;
00400 
00401                                                 battlefield[result.x2][result.y2].player = -1;
00402 
00403                                                 /* make piece empty     */
00404                                                 battlefield[result.x1][result.y1].occupied.name = "UNOCCUPIED";
00405                                                 battlefield[result.x1][result.y1].occupied.rank = -1;
00406                                                 battlefield[result.x1][result.y1].occupied.revealed = -1;
00407                                                 battlefield[result.x1][result.y1].player = -1;
00408                                                 
00409                                                 /* clear attacking piece */
00410                                                 draw.bitmapno = 13;
00411                                                 draw.x = result.x1; draw.y = result.y1;
00412                                                 draw_Post(&draw);
00413 
00414                                                 vccAwait(5.0);
00415 
00416                                                 /* clear defending piece */
00417                                                 draw.bitmapno = 13;
00418                                                 draw.x = result.x2; draw.y = result.y2;
00419                                                 draw_Post(&draw);
00420 
00421 
00422 
00423                                                 /* send the -1 signal indicating clearance of pieces to other player */
00424                                                 result.player = -1;
00425                                                 turn = 0;
00426                                                 move_out_Post(&result);
00427                                         } else if (decide_winner(result.x1 , result.y1 , result.x2 , result.y2) == 4){
00428                                                 vccPrintPdxDebugInfo("Flag Has been captured! Youuuuuhooouuuu\n");
00429                                                 out.text = "WINNER"; out.x = 0; out.y = 6;
00430                                                 print_Post(&out);
00431                                         } /* else if decide_winner */
00432                                 } else { /* if we have a move */
00433                                         if (legal_move(result.x1 , result.y1 , result.x2 , result.y2)){
00434                                                 vccPrintPdxDebugInfo("Moving %s from [%d][%d] to [%d][%d]\n",battlefield[result.x1][result.y1].occupied.name , result.x1 , result.y1 , result.x2 , result.y2);
00435 
00436 
00437                                                 draw.bitmapno = get_bitmapno(battlefield[result.x1][result.y1].occupied.name); 
00438                                                 draw.x = result.x2; draw.y = result.y2;
00439                                                 draw_Post(&draw);
00440                                 
00441                                                 vccAwait(5.0);
00442 
00443                                                 /* clear defending piece */
00444                                                 draw.bitmapno = 13;
00445                                                 draw.x = result.x1; draw.y = result.y1;
00446                                                 draw_Post(&draw);
00447 
00448                                                 tmp = battlefield[result.x1][result.y1].occupied.revealed; /* has piece been previously revealed? */
00449                                                 perform_move(player_no , result.x1 , result.y1 , result.x2 , result.y2 , tmp);
00450                                         
00451                                                 turn = 0; 
00452                                                 move_out_Post(&result);
00453                                         }/* if */
00454                                 }/* else */
00455                         }/* if */
00456                    } else { /* if turn = 1 */
00457                                 out.text = "WAIT"; out.x = 0; out.y = -2;
00458                                 print_Post(&out);
00459                                 vccPrintPdxDebugInfo("\nIt is not your turn\n");                
00460                         } /* else */
00461                  } else { /* if player_no == result.player */                   
00462                         if ( result.player == -1 ){
00463                                 /* there has been an attack which was equal*/
00464                                 /* make piece empty     */
00465                                 battlefield[result.x2][result.y2].occupied.name = "UNOCCUPIED";
00466                                 battlefield[result.x2][result.y2].occupied.rank = -1;
00467                                 battlefield[result.x2][result.y2].occupied.revealed = -1;
00468                                 battlefield[result.x2][result.y2].player = -1;
00469 
00470                                 /* make piece empty     */
00471                                 battlefield[result.x1][result.y1].occupied.name = "UNOCCUPIED";
00472                                 battlefield[result.x1][result.y1].occupied.rank = -1;
00473                                 battlefield[result.x1][result.y1].player = -1;
00474 
00475                                 /* clear attacking piece */
00476                                 draw.bitmapno = 13;
00477                                 draw.x = result.x1; draw.y = result.y1;
00478                                 draw_Post(&draw);
00479 
00480                                 vccAwait(5.0);
00481 
00482                                 /* clear defending piece */
00483                                 draw.bitmapno = 13;
00484                                 draw.x = result.x2; draw.y = result.y2;
00485                                 draw_Post(&draw);
00486 
00487                         } /* if */
00488                         else { 
00489 
00490                                 if ( (battlefield[result.x1][result.y1].player != -1) && (battlefield[result.x2][result.y2].player != -1) ){
00491                                         if ( (battlefield[result.x1][result.y1].player) !=  (battlefield[result.x2][result.y2].player) ){
00492                                                 /* if two pieces moved are different then we know there was an attack so reveal pieces*/
00493                                                 vccPrintPdxDebugInfo("\nREVEAL\n");             
00494                                                 battlefield[result.x1][result.y1].occupied.revealed = 1;
00495                                         }
00496                                 }
00497 
00498 
00499                                 if (battlefield[result.x1][result.y1].occupied.revealed == 1){
00500                                         draw.bitmapno = get_bitmapno(battlefield[result.x1][result.y1].occupied.name); 
00501                                                 vccPrintPdxDebugInfo("\nBIT : %d\n",draw.bitmapno);             
00502                                   }
00503                                 else draw.bitmapno = 12;
00504 
00505                                 draw.x = result.x2; draw.y = result.y2;
00506                                 draw_Post(&draw);
00507 
00508                                 vccAwait(5.0);
00509 
00510                                 draw.bitmapno = 13;
00511                                 draw.x = result.x1; draw.y = result.y1;
00512                                 draw_Post(&draw);
00513 
00514                                 perform_move(result.player , result.x1 , result.y1 , result.x2 , result.y2 , battlefield[result.x1][result.y1].occupied.revealed);                      
00515                                 turn = 1; /* other player played (no change if the observer since never gets inside */
00516                                 } /* else */
00517                   } /* else */
00518                 } /* else if */
00519           } else if (player_no == 2){
00520            if (result.player != 2){ /* if this has been sent by observer then do nothing */
00521                 if (result.y1 < 0){
00522                         temp_y1 = abs(result.y1);
00523 
00524                         update_battlefield( start[result.x1][temp_y1].name , result.player , result.x2 , result.y2);
00525                 
00526                         draw.bitmapno = get_bitmapno(start[result.x1][temp_y1].name); 
00527                         draw.x = result.x2; draw.y = result.y2;
00528                         draw_Post(&draw);
00529                 } else if ( result.player == -1 ){
00530                         /* there has been an attack which was equal*/
00531                         /* make piece empty     */
00532                         battlefield[result.x2][result.y2].occupied.name = "UNOCCUPIED";
00533                         battlefield[result.x2][result.y2].occupied.rank = -1;
00534                         battlefield[result.x2][result.y2].occupied.revealed = -1;
00535                         battlefield[result.x2][result.y2].player = -1;
00536 
00537                         /* make piece empty     */
00538                         battlefield[result.x1][result.y1].occupied.name = "UNOCCUPIED";
00539                         battlefield[result.x1][result.y1].occupied.rank = -1;
00540                         battlefield[result.x1][result.y1].occupied.revealed = -1;
00541                         battlefield[result.x1][result.y1].player = -1;
00542 
00543                         /* clear attacking piece */
00544                         draw.bitmapno = 13;
00545                         draw.x = result.x1; draw.y = result.y1;
00546                         draw_Post(&draw);
00547 
00548                         vccAwait(5.0);
00549 
00550                         /* clear defending piece */
00551                         draw.bitmapno = 13;
00552                         draw.x = result.x2; draw.y = result.y2;
00553                         draw_Post(&draw);
00554 
00555                 } else { 
00556                         draw.bitmapno = get_bitmapno(battlefield[result.x1][result.y1].occupied.name);
00557 
00558                         draw.x = result.x2; draw.y = result.y2;
00559                         draw_Post(&draw);
00560 
00561                         vccAwait(5.0);
00562 
00563                         draw.bitmapno = 13;
00564                         draw.x = result.x1; draw.y = result.y1;
00565                         draw_Post(&draw);
00566 
00567                         perform_move(result.player , result.x1 , result.y1 , result.x2 , result.y2 , battlefield[result.x1][result.y1].occupied.revealed);                      
00568                         turn = 1; /* other player played (no change if the observer since never gets inside */
00569                 } /* else */
00570            } /* if result.player != 2 */
00571           } /* else if player_no == 2 */
00572         }/*if (move_in enabled) */
00573                                                 
00574         if (button_in_Enabled()){/* if move_enabled */
00575                 pressed = *button_in_Value();
00576                 vccPrintPdxDebugInfo("\nButton pressed\n");             
00577 
00578                 if ((pressed.button_no == 1) && (player_no != 2)){
00579                         vccPrintPdxDebugInfo("\nStart button pressed");
00580                         if (pieces_placed()){
00581                                 vccPrintPdxDebugInfo("\nStarting game\n");
00582                                 out.text = "STARTING"; out.x = 0; out.y = -2;
00583                                 print_Post(&out);
00584 
00585                                 battle_started = TRUE;
00586                         } else {
00587                                 vccPrintPdxDebugInfo("\nYou have to place all pieces before starting the game\n");
00588                                 out.text = "PLACE@ALL"; out.x = 0; out.y = 6;
00589                                 print_Post(&out);
00590                         }
00591                 }else if ((pressed.button_no == 2) && (player_no != 2)){
00592                         vccPrintPdxDebugInfo("Quit button pressed\n...EXITING...");
00593                         out.text = "QUITING"; out.x = 0; out.y = 6;
00594                         print_Post(&out);
00595                 } else if (pressed.button_no == 0){
00596                         player_no = pressed.player;
00597                         turn = 1;
00598                         vccPrintPdxDebugInfo("\nPlayer is: %d\n",player_no);            
00599                 }       
00600 

void poin_entry_Init  
 

Function called upon starting the simulation.

This function is called directly when the simulation and VCC is started.
In it, the start array and battlefield array are initialised by calling the initialise_start and initialise_battlefield functions.
In addition, the variable battle_started is set to FALSE to indicate that we are at the initialisation phase of the game. Thi svariable is set to TRUE only when the user has placed
all of his pieces on the board, and he pressses the "start" button.

00143                        {
00144 
00145 
00146 initialise_start();
00147 initialise_battlefield();
00148 battle_started = FALSE;
00149 
00150 }

int strcmp const char *    s1,
const char *    s2
 

Compare two strings.

Function used to compare two strings. Declared in order to be used

int vccPrintPdxDebugInfo const char *    format,
...   
 

Function used for debugging.

This function is the equivalent of printf in VCC. Has been used throughout the program for debugging


Variable Documentation

int battle_started
 

Variable used to distinguish if the battle has began or not.

If battle has started then we use different structures and perform different actions compared to those used during the initialisation.
At the start of the game this variable is set to FALSE and it is only set to TRUE when the start button is pressed

int player_no
 

Variable used to identify the player to whom this specific module belongs to.

This variable is set by a button signal that is sent by the Input module.
This signal is unique and it is the first thing that is sent in the game. During the game the player_no variable is used to identify the source or destination
of a message and act accordingly.

int turn
 

Variable used to detect if it is a player's turn or not

This variable is set to 0 at the start and then to 1 when a player presses the start button.
Every time a legal move or attack is made during the battle, it is set back to 0.
If a player tries to make a move while it is 0, it is reported that it is not his turn


Generated on Sat Mar 16 13:12:16 2002 for SLIP 2002 - Stratego2Go by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002