Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
4.4 kB
2
Indexable
Never
Doctor doctor = new Doctor("doctor", 1);         Detective detective = new Detective("detective", 2);         GodFather godFather = new GodFather("father", 3);         OrdinaryCitizen citizen = new OrdinaryCitizen("citizen", 4);         OrdinaryMafia mafia = new OrdinaryMafia("mafia", 6);         Joker joker = new Joker("jokker", 7);         Natasha natasha = new Natasha("n", 0);         Sniper sniper = new Sniper("sniper", 9);         DoctorLecter lecter = new DoctorLecter("lecter", 10);          List<Player> players = new ArrayList<>();         players.add(doctor);         players.add(godFather);         players.add(detective);         players.add(citizen);         players.add(mafia);         players.add(joker);         players.add(sniper);         players.add(lecter);          GameState gameState = new GameState(players);         System.out.println(gameState.getSilentPlayerInLastRound());//null         System.out.println(gameState.allPlayers().size());//8         System.out.println(gameState.isDay());//true         System.out.println(gameState.getWinners().size());//0         System.out.println(gameState.getDeadPlayersInLastRound());//[]         System.out.println(gameState.getExecutedPlayer());//null         gameState.nextNight();         System.out.println(detective.action(godFather)); // NO_MAFIA         doctor.action(detective);         lecter.action(joker);         sniper.action(doctor);          gameState.nextDay();         System.out.println(sniper.getNumberOfBulletsLeft());//1         System.out.println(gameState.getAlivePlayers().size()); // 7         System.out.println(gameState.getDeadPlayersInLastRound().contains(doctor)); // true         System.out.println(godFather.isAsked()); // true         System.out.println(citizen.isMute());//false         System.out.println(doctor.getNumberOfSelfSave()); // 2          doctor.vote(joker);         godFather.vote(joker);         detective.vote(joker);         citizen.vote(detective);         mafia.vote(godFather);         gameState.nextNight();         System.out.println(gameState.getExecutedPlayer()); // null         godFather.action(sniper);         doctor.action(doctor);         natasha.action(detective);         sniper.action(godFather);         detective.action(godFather);         System.out.println(detective.action(godFather)); // MAFIA          gameState.nextDay();         System.out.println(detective.isMute());//true         System.out.println(gameState.getAlivePlayers().size()); // 5         System.out.println(gameState.getDeadPlayersInLastRound().size()); // 2         System.out.println(gameState.getDeadPlayersInLastRound().contains(citizen)); // false         System.out.println(doctor.getNumberOfSelfSave()); // 1         System.out.println(gameState.getSilentPlayerInLastRound().getName());//detective          detective.vote(godFather);         doctor.vote(godFather);         godFather.vote(detective);          gameState.nextNight();         System.out.println(godFather.isAlive()); // false         System.out.println(gameState.getExecutedPlayer() == godFather); // false         System.out.println(gameState.getWinners().size()); // 0         mafia.action(doctor);         doctor.action(doctor);         sniper.action(mafia);         lecter.action(mafia);         natasha.action(lecter);          gameState.nextDay();         System.out.println(lecter.isMute());//true         System.out.println(gameState.getAlivePlayers().size()); // 5         System.out.println(gameState.getDeadPlayersInLastRound().size()); // 0         System.out.println(gameState.getDeadPlayersInLastRound().contains(doctor)); // false         System.out.println(doctor.getNumberOfSelfSave()); // 0         System.out.println(gameState.getSilentPlayerInLastRound().getName());//lecter         System.out.println(gameState.getWinners().size());//0         citizen.vote(sniper);         mafia.vote(citizen);         sniper.vote(citizen);         lecter.vote(citizen);         detective.vote(citizen);          gameState.nextNight();         System.out.println(doctor.isAlive()); // true         System.out.println(gameState.getExecutedPlayer() == citizen); // true         System.out.println(gameState.getWinners().size()); // 3         System.out.println(gameState.getWinners().contains(detective)); // false         System.out.println(gameState.getWinners().contains(mafia)); // true         System.out.println(gameState.getAlivePlayers().size());//4