Main Page Data Structures File List Globals
output_button.c File ReferenceOutputs a button message to the Core module.
More...
#include "white_interface.h"
#include "e:\AndrewWorkspace\Stratego\input.h"
Go to the source code of this file.
Detailed Description
Outputs a button 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 button message (which contains its player number) whenever it receives a button press message from the process_input block. The button message is then sent to the game core.
In addition, the output_button block is responsible for telling the Core module the player number that has been assigned to it by Lobby module at the start of the game. It does this by sending a button message with the button_no parameter set to 0 to the Core module as soon as it receives the player number from the lobby.
Definition in file output_button.c.
Function Documentation
|
VCC Init function.
This function runs when the VCC simulation is first started.
Definition at line 31 of file output_button.c.
|
|
VCC Run function.
This runs each time a message arrives at the output_move block's player or in port.
Definition at line 36 of file output_button.c.
References player_no.
00037 {
00038 int input;
00039 button output;
00040
00041
00042
00043
00044 if (player_Enabled())
00045 {
00046 player_no = player_Value();
00047 output.player = player_no;
00048 output.button_no = 0;
00049 out_Post(&output);
00050 }
00051
00052
00053
00054
00055
00056 if (in_Enabled())
00057 {
00058 input = in_Value();
00059
00060 output.player = player_no;
00061 output.button_no = input;
00062 out_Post(&output);
00063 }
00064 }
|
Variable Documentation
|
Stores the player number that is supplied by the lobby module at the start of the game.
Definition at line 28 of file output_button.c.
Referenced by poin_entry_Run. |
|