graphics interface
This section provides an insight and description of the graphics module connection to the
core module.
It should be noted that the Graphics module was written
by Alex Carter.
Core module -> Graphics Module interface

The Graphics module is responsible for anything that the user sees on his screen. It focuses on drawing pictures and strings on the console.
Considering that no processing takes part in the Graphics module (i.e. whatever command the graphics module receives it processes it but does not
check if it is legal or not) the core module has to ensure that the Draw and PrintString commands sent are legal. Thus at this stage the core
must filter user input, decide on its legality and then draw and print the relevant messages.
As shown in the diagram there are two kind of messages sent between the core and teh graphics. These are DrawSprites and PrintStrings and their structure
is defined below:
The DrawSprite composite consists of:
int bitmapno : Integer identification of the bitmap piece that should be drawn
int x : Integer x-coordinate of the square that the piece should be drawn on
int y : Integer y-coordinate of the square that the piece should be drawn on
The bitmapno is an integer that is agreed by me and Alex. It is a unique identifier for each piece available in the Stratego2go game.
These identifiers are defined in the table below:
0: "Marshal"
1: "General"
2: "Colonel"
3: "Major"
4: "Captain"
5: "Lieutenant"
6: "Sergeant"
7: "Miner"
8: "Scout"
9: "Spy"
10: "Bomb"
11: "Flag"
12: "Empty"
13: "Covered"
Number 12 is an emty piece i.e. no piece is on that square.
Number 13 is covered. i.e. there is a piece on that square but we do not know what it is. This is used for showing pieces on an opponent's screen that
belong to a player.
Therefore, when we have a move, the core sends a Draw command to the graphics with the appropriate bitmap number to draw the piece moved to x,y.
One could say that the graphics is ignorant of even what game is being played, as its duty is to draw a bitmap on the consoles' screen.
The PrintString composite consists of:
String text : String to be written on teh screen
int x : Integer x-coordinate of the point that the string should start
int y : Integer y-coordinate of the point that the string should start
As we see the PrintString command draws a string on the screen. It is essential to specify the coordinates as during the lobby, initialisation and
battle phase we need to draw text on different parts of the screen.
Please email me if you have any questions.