1 package com.codingame.game;
4 import java.util.stream.Collectors;
6 import com.codingame.gameengine.core.MultiplayerGameManager;
7 import com.google.inject.Inject;
8 import com.google.inject.Singleton;
11 public class GameManager {
12 @Inject private MultiplayerGameManager<Player> gameManager;
14 Player getPlayer(int index) { return gameManager.getPlayer(index); }
15 List<Player> getPlayers() { return gameManager.getPlayers(); }
16 List<Player> getActivePlayers() {
17 return gameManager.getPlayers().stream()
18 .filter(p -> p.isActive() && !p.model.hit)
19 .collect(Collectors.toList());
22 void endGame() { gameManager.endGame(); }