Main Page   Data Structures   File List   Globals  

output_move.c

Go to the documentation of this file.
00001 #include "white_interface.h"
00002 #include "e:\AndrewWorkspace\Stratego\input.h"
00003 
00031 int player_no;
00032 
00037 /* Init Function */
00038 void poin_entry_Init()
00039 {
00040 }
00041 
00046 /* Run Function */
00047 void poin_entry_Run()
00048 {
00049   temp_move input;
00050   move output;
00051 
00052   /* if a player number is received, write it to the
00053      player_no global variable. */
00054 
00055   if (player_Enabled())
00056     player_no = player_Value();
00057 
00058   /* if a temp_move message is received, create a move
00059      message from this and the player number and send 
00060      it to the core module. */
00061 
00062 if (in_Enabled())
00063   {
00064     input = *in_Value();
00065 
00066     output.player = player_no;
00067     output.x1 = input.start_x;
00068     output.y1 = input.start_y;
00069     output.x2 = input.end_x;
00070     output.y2 = input.end_y;
00071 
00072     out_Post(&output);
00073   }
00074 }
00075 

Copyright © 2002 Andrew Bates
Last Updated 03/04/02