Whenever the player receives a move command with his identifier it means that he tried to move a piece
by using his console.
i.e. he dragged a piece and the coordinates that he referenced were recorded.
Whenever this occurs then we have to check every detail of the movement to verify that all the rules have
been preserved. This is the most important part of the game rules, the gateway one would say, as if the move is considered legal
the move is processed and sent to all participants. This creates a situation that can not be inverted as all the structures
and consoles will have changed to accomodate this move.
The Dat Flow Diagram of this case is displayed below.
Circles represent terminal conditions. When we have text inside inverted commas (") then it represents a string being outputted on the user's
console. When there is no commas then commands are represented. When there is a diamond then we have a conditional.
In the diagram we have integrated the turn based rule and the Stratego game rules.
NOTES ON DIAGRAM
1: the check_piece_clicked function checks the two coordinates of the move function (x1,y1 and x2,y2) to see if tehy belong to the appropriate player
2: the "process move" terminal symbol handles the checks for legality of move as indicated by the rules of the game and the completion of the move
Actions performed are:
Please email me if you have any questions.
|