The IGameClient interface has some methods that are only used to notify a message to the user and
others that also update the grid. The entire grid is passed as argument in the form of an array of arrays
of integer values. Each value can assume the value 0 meaning that the cell is not occupied by any
symbol, the value 1 to assign the cell to player one and - 1 for player two.
interface IGameClient
{
function waitAdversary() : Void;
function adversaryQuit() : Void;
function tie(g : Array < Array < Int > > ) : Void;
function winner(g : Array < Array < Int > > ) : Void;
function looser(g : Array < Array < Int > > ) : Void;
function invalidMove() : Void;
function yourTurn(g : Array < Array < Int > > ) : Void;
function otherTurn(g : Array < Array < Int > > ) : Void;
}
Figure 15-3
Chapter 15: Putting It All Together with haXe Remoting
445
The IPlayerServer interface is very short; the attend() method is invoked by the user interface
when the user expresses the desire to join in a new game, whereas the second method place() is used
to set a symbol at the specified row and column.
Pages:
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833