// ------------- Service ------------------- // GameService id RegisterPlayer() bool MyTurn(id) GameAction GetLatestAction() void MakeAction(id, GameAction); GameState GetGameState(id); GameAction id x y GameState RUNNING TIE WIN LOSS // ------------- Client ------------------- // id = RegisterPlayer(); gameOver = false; oldAction = NULL; while(!gameOver) { gameState = GetGameState(id); if( !gameState.RUNNING ) { WIN, LOSE, TIE? gameOver = true; } else { if( MyTurn(id) ) { // updatera vad den andra gjort action = GetLatestAction(); GUI.doStuf(action.id, action.x, action.y); // make your move move = GUI.MakeMove(); MakeAction(id, move); } else { Sleep(1000); } } }