Main Page   Data Structures   File List   Globals  

output_move.c File Reference

Outputs a move message to the Core module. More...

#include "white_interface.h"
#include "e:\AndrewWorkspace\Stratego\input.h"

Go to the source code of this file.

Functions

void poin_entry_Init ()
 VCC Init function. More...

void poin_entry_Run ()
 VCC Run function. More...


Variables

int player_no


Detailed Description

Outputs a move message to the Core module.

This block receives a player number from the Lobby module at the start of the game. It uses this to create a move message (which contains its player number) whenever it receives a temp_move message from the process_input block. The move message is then sent to the game core.

Definition in file output_move.c.


Function Documentation

void poin_entry_Init  
 

VCC Init function.

This function runs when the VCC simulation is first started.

Definition at line 38 of file output_move.c.

00039 {
00040 }

void poin_entry_Run  
 

VCC Run function.

This runs each time a message arrives at the output_move block's player or in port.

Definition at line 47 of file output_move.c.

References player_no.

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 }


Variable Documentation

int player_no
 

Stores the player number that is supplied by the lobby module at the start of the game.

Definition at line 31 of file output_move.c.

Referenced by poin_entry_Run.


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