MCPcopy Create free account
hub / github.com/catabriga/graphwar / finishGameMessage

Method finishGameMessage

src/Graphwar/GameData.java:1099–1136  ·  view source on GitHub ↗
(String[] info)

Source from the content-addressed store, hash-verified

1097 }
1098
1099 private void finishGameMessage(String[] info) throws Exception
1100 {
1101 this.gameState = Constants.PRE_GAME;
1102
1103 this.drawingFunction = false;
1104 this.exploding = false;
1105 this.nextTurnSent = false;
1106
1107 stopComputers();
1108
1109 ((GameScreen)graphwar.getUI().getScreen(Constants.GAME_SCREEN)).stopPanel();
1110 Thread.sleep(200); //This should be enough so that the game is not being painted when players are removed
1111
1112 ListIterator<Player> itr = players.listIterator();
1113
1114 while(itr.hasNext())
1115 {
1116 Player player = itr.next();
1117
1118 Soldier[] soldiers = player.getSoldiers();
1119
1120 for(int i=0; i<soldiers.length; i++)
1121 {
1122 if(soldiers[i].isAlive())
1123 {
1124 ((PreGameScreen)graphwar.getUI().getScreen(Constants.PRE_GAME_SCREEN)).addChat(null, player.getName()+" won the game.");
1125 break;
1126 }
1127 }
1128
1129 }
1130
1131 removeDisconnectedPlayers();
1132
1133 updateReadyButton();
1134 graphwar.getUI().setScreen(Constants.PRE_GAME_SCREEN);
1135 graphwar.getGlobalClient().recreateRoom();
1136 }
1137
1138 private void setAngleMessage(String[] info) throws Exception
1139 {

Callers 1

handleMessageMethod · 0.95

Calls 13

stopComputersMethod · 0.95
getSoldiersMethod · 0.95
getNameMethod · 0.95
updateReadyButtonMethod · 0.95
getScreenMethod · 0.80
getUIMethod · 0.80
isAliveMethod · 0.80
setScreenMethod · 0.80
getGlobalClientMethod · 0.80
stopPanelMethod · 0.65
addChatMethod · 0.45

Tested by

no test coverage detected