2021-12-27 19:01:39 +00:00
|
|
|
/*
|
|
|
|
* This file is part of Kenshins Hide and Seek
|
|
|
|
*
|
|
|
|
* Copyright (c) 2021 Tyler Murphy.
|
|
|
|
*
|
|
|
|
* Kenshins Hide and Seek free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2021-12-27 19:14:32 +00:00
|
|
|
* he Free Software Foundation version 3.
|
2021-12-27 19:01:39 +00:00
|
|
|
*
|
|
|
|
* Kenshins Hide and Seek is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-12-26 22:58:18 +00:00
|
|
|
package net.tylermurphy.hideAndSeek.game;
|
|
|
|
|
|
|
|
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
|
|
|
|
|
2022-04-12 19:11:49 +00:00
|
|
|
import java.util.*;
|
2021-12-26 22:58:18 +00:00
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
import net.tylermurphy.hideAndSeek.util.Status;
|
2022-04-11 16:36:11 +00:00
|
|
|
import net.tylermurphy.hideAndSeek.util.Version;
|
2021-12-26 22:58:18 +00:00
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
import org.bukkit.ChatColor;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.scoreboard.*;
|
|
|
|
|
|
|
|
public class Board {
|
|
|
|
|
2022-04-13 17:47:59 +00:00
|
|
|
private static final List<UUID> Hider = new ArrayList<>(), Seeker = new ArrayList<>(), Spectator = new ArrayList<>();
|
|
|
|
private static final Map<UUID, Player> playerList = new HashMap<>();
|
|
|
|
private static final Map<UUID, CustomBoard> customBoards = new HashMap<>();
|
2021-12-26 22:58:18 +00:00
|
|
|
|
|
|
|
public static boolean isPlayer(Player player) {
|
2022-04-13 17:47:59 +00:00
|
|
|
return playerList.containsKey(player.getUniqueId());
|
2021-12-29 04:37:54 +00:00
|
|
|
}
|
|
|
|
|
2021-12-26 22:58:18 +00:00
|
|
|
public static boolean isPlayer(CommandSender sender) {
|
2022-04-13 17:47:59 +00:00
|
|
|
return playerList.containsKey(Bukkit.getPlayer(sender.getName()).getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean isHider(Player player) {
|
2022-04-13 17:47:59 +00:00
|
|
|
return Hider.contains(player.getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean isSeeker(Player player) {
|
2022-04-13 17:47:59 +00:00
|
|
|
return Seeker.contains(player.getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean isSpectator(Player player) {
|
2022-04-13 17:47:59 +00:00
|
|
|
return Spectator.contains(player.getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static int sizeHider() {
|
|
|
|
return Hider.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int sizeSeeker() {
|
|
|
|
return Seeker.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int size() {
|
|
|
|
return playerList.values().size();
|
|
|
|
}
|
|
|
|
|
2022-04-13 17:47:59 +00:00
|
|
|
public static void check(){
|
|
|
|
for(UUID uuid : playerList.keySet()){
|
|
|
|
if(Bukkit.getPlayer(uuid) == null)
|
|
|
|
playerList.remove(uuid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-12-26 22:58:18 +00:00
|
|
|
public static List<Player> getHiders(){
|
|
|
|
return Hider.stream().map(playerList::get).collect(Collectors.toList());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<Player> getSeekers(){
|
|
|
|
return Seeker.stream().map(playerList::get).collect(Collectors.toList());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Player getFirstSeeker(){
|
|
|
|
return playerList.get(Seeker.get(0));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<Player> getSpectators(){
|
|
|
|
return Spectator.stream().map(playerList::get).collect(Collectors.toList());
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<Player> getPlayers(){
|
|
|
|
return new ArrayList<>(playerList.values());
|
|
|
|
}
|
|
|
|
|
2022-04-13 17:47:59 +00:00
|
|
|
public static Player getPlayer(UUID uuid) {
|
|
|
|
return playerList.get(uuid);
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void addHider(Player player) {
|
2022-04-13 17:47:59 +00:00
|
|
|
Hider.add(player.getUniqueId());
|
|
|
|
Seeker.remove(player.getUniqueId());
|
|
|
|
Spectator.remove(player.getUniqueId());
|
|
|
|
playerList.put(player.getUniqueId(), player);
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void addSeeker(Player player) {
|
2022-04-13 17:47:59 +00:00
|
|
|
Hider.remove(player.getUniqueId());
|
|
|
|
Seeker.add(player.getUniqueId());
|
|
|
|
Spectator.remove(player.getUniqueId());
|
|
|
|
playerList.put(player.getUniqueId(), player);
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void addSpectator(Player player) {
|
2022-04-13 17:47:59 +00:00
|
|
|
Hider.remove(player.getUniqueId());
|
|
|
|
Seeker.remove(player.getUniqueId());
|
|
|
|
Spectator.add(player.getUniqueId());
|
|
|
|
playerList.put(player.getUniqueId(), player);
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void remove(Player player) {
|
2022-04-13 17:47:59 +00:00
|
|
|
Hider.remove(player.getUniqueId());
|
|
|
|
Seeker.remove(player.getUniqueId());
|
|
|
|
Spectator.remove(player.getUniqueId());
|
|
|
|
playerList.remove(player.getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static boolean onSameTeam(Player player1, Player player2) {
|
2022-04-13 17:47:59 +00:00
|
|
|
if(Hider.contains(player1.getUniqueId()) && Hider.contains(player2.getUniqueId())) return true;
|
|
|
|
else if(Seeker.contains(player1.getUniqueId()) && Seeker.contains(player2.getUniqueId())) return true;
|
|
|
|
else return Spectator.contains(player1.getUniqueId()) && Spectator.contains(player2.getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void reload() {
|
|
|
|
Hider.clear();
|
|
|
|
Seeker.clear();
|
|
|
|
Spectator.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void createLobbyBoard(Player player) {
|
|
|
|
createLobbyBoard(player, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void createLobbyBoard(Player player, boolean recreate) {
|
2022-04-13 17:47:59 +00:00
|
|
|
CustomBoard board = customBoards.get(player.getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
if(recreate) {
|
|
|
|
board = new CustomBoard(player, "&l&eHIDE AND SEEK");
|
|
|
|
board.updateTeams();
|
|
|
|
}
|
2022-04-12 19:11:49 +00:00
|
|
|
int i=0;
|
|
|
|
for(String line : LOBBY_CONTENTS){
|
|
|
|
if(line.equalsIgnoreCase("")){
|
|
|
|
board.addBlank();
|
|
|
|
} else if(line.contains("{COUNTDOWN}")){
|
|
|
|
if(!lobbyCountdownEnabled){
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{COUNTDOWN}", COUNTDOWN_ADMINSTART));
|
|
|
|
} else if(Game.countdownTime == -1){
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{COUNTDOWN}", COUNTDOWN_WAITING));
|
|
|
|
} else {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{COUNTDOWN}", COUNTDOWN_COUNTING.replace("{AMOUNT}",Game.countdownTime+"")));
|
|
|
|
}
|
|
|
|
} else if(line.contains("{COUNT}")){
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{COUNT}", getPlayers().size()+""));
|
|
|
|
} else if(line.contains("{SEEKER%}")){
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{SEEKER%}", getSeekerPercent()+""));
|
|
|
|
} else if(line.contains("{HIDER%}")){
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{HIDER%}", getHiderPercent()+""));
|
2021-12-26 22:58:18 +00:00
|
|
|
} else {
|
2022-04-12 19:11:49 +00:00
|
|
|
board.setLine(String.valueOf(i), line);
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
2022-04-12 19:11:49 +00:00
|
|
|
i++;
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
board.display();
|
2022-04-13 17:47:59 +00:00
|
|
|
customBoards.put(player.getUniqueId(), board);
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void createGameBoard(Player player){
|
|
|
|
createGameBoard(player, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void createGameBoard(Player player, boolean recreate){
|
2022-04-13 17:47:59 +00:00
|
|
|
CustomBoard board = customBoards.get(player.getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
if(recreate) {
|
2022-04-12 19:11:49 +00:00
|
|
|
board = new CustomBoard(player, GAME_TITLE);
|
2021-12-26 22:58:18 +00:00
|
|
|
board.updateTeams();
|
|
|
|
}
|
2022-04-12 19:11:49 +00:00
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
for(String line : GAME_CONTENTS){
|
|
|
|
if(line.equalsIgnoreCase("")){
|
|
|
|
board.addBlank();
|
2021-12-26 22:58:18 +00:00
|
|
|
} else {
|
2022-04-12 19:11:49 +00:00
|
|
|
if(line.contains("{TIME}")) {
|
|
|
|
String value = Game.timeLeft/60 + "m" + Game.timeLeft%60 + "s";
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{TIME}", value));
|
|
|
|
} else if(line.contains("{TEAM}")) {
|
|
|
|
String value = getTeam(player);
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{TEAM}", value));
|
|
|
|
} else if(line.contains("{BORDER}")) {
|
|
|
|
if(!worldborderEnabled) continue;
|
|
|
|
if(Game.worldBorder == null || Game.status == Status.STARTING){
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{BORDER}", BORDER_COUNTING.replace("{AMOUNT}", "0")));
|
|
|
|
} else if(!Game.worldBorder.isRunning()) {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{BORDER}", BORDER_COUNTING.replaceFirst("\\{AMOUNT}", Game.worldBorder.getDelay()/60+"").replaceFirst("\\{AMOUNT}", Game.worldBorder.getDelay()%60+"")));
|
|
|
|
} else {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{BORDER}", BORDER_DECREASING));
|
|
|
|
}
|
|
|
|
} else if(line.contains("{TAUNT}")){
|
|
|
|
if(!tauntEnabled) continue;
|
|
|
|
if(Game.taunt == null || Game.status == Status.STARTING) {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{TAUNT}", TAUNT_COUNTING.replace("{AMOUNT}", "0")));
|
|
|
|
} else if(!tauntLast && Hider.size() == 1){
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{TAUNT}", TAUNT_EXPIRED));
|
|
|
|
} else if(!Game.taunt.isRunning()) {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{TAUNT}", TAUNT_COUNTING.replaceFirst("\\{AMOUNT}", Game.taunt.getDelay() / 60 + "").replaceFirst("\\{AMOUNT}", Game.taunt.getDelay() % 60 + "")));
|
|
|
|
} else {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{TAUNT}", TAUNT_ACTIVE));
|
|
|
|
}
|
|
|
|
} else if(line.contains("{GLOW}")){
|
|
|
|
if(!glowEnabled) return;
|
|
|
|
if(Game.glow == null || Game.status == Status.STARTING || !Game.glow.isRunning()) {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{GLOW}", GLOW_INACTIVE));
|
|
|
|
} else {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{GLOW}", GLOW_ACTIVE));
|
|
|
|
}
|
|
|
|
} else if(line.contains("{#SEEKER}")) {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{#SEEKER}", getSeekers().size()+""));
|
|
|
|
} else if(line.contains("{#HIDER}")) {
|
|
|
|
board.setLine(String.valueOf(i), line.replace("{#HIDER}", getHiders().size()+""));
|
|
|
|
} else {
|
|
|
|
board.setLine(String.valueOf(i), line);
|
|
|
|
}
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
2022-04-12 19:11:49 +00:00
|
|
|
i++;
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
board.display();
|
2022-04-13 17:47:59 +00:00
|
|
|
customBoards.put(player.getUniqueId(), board);
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void removeBoard(Player player) {
|
|
|
|
ScoreboardManager manager = Bukkit.getScoreboardManager();
|
|
|
|
assert manager != null;
|
|
|
|
player.setScoreboard(manager.getMainScoreboard());
|
2022-04-13 17:47:59 +00:00
|
|
|
customBoards.remove(player.getUniqueId());
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void reloadLobbyBoards() {
|
|
|
|
for(Player player : playerList.values())
|
|
|
|
createLobbyBoard(player, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void reloadGameBoards() {
|
|
|
|
for(Player player : playerList.values())
|
|
|
|
createGameBoard(player, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void reloadBoardTeams() {
|
|
|
|
for(CustomBoard board : customBoards.values())
|
|
|
|
board.updateTeams();
|
|
|
|
}
|
|
|
|
|
|
|
|
private static String getSeekerPercent() {
|
|
|
|
if(playerList.values().size() < 2)
|
|
|
|
return " --";
|
|
|
|
else
|
|
|
|
return " "+(int)(100*(1.0/playerList.size()));
|
|
|
|
}
|
|
|
|
|
|
|
|
private static String getHiderPercent() {
|
|
|
|
if(playerList.size() < 2)
|
|
|
|
return " --";
|
|
|
|
else
|
|
|
|
return " "+(int)(100-100*(1.0/playerList.size()));
|
|
|
|
}
|
|
|
|
|
|
|
|
private static String getTeam(Player player) {
|
|
|
|
if(isHider(player)) return ChatColor.GOLD + "HIDER";
|
|
|
|
else if(isSeeker(player)) return ChatColor.RED + "SEEKER";
|
|
|
|
else if(isSpectator(player)) return ChatColor.GRAY + "SPECTATOR";
|
|
|
|
else return ChatColor.WHITE + "UNKNOWN";
|
|
|
|
}
|
|
|
|
|
2022-04-13 17:47:59 +00:00
|
|
|
public static void cleanup(){
|
|
|
|
playerList.clear();
|
|
|
|
Hider.clear();
|
|
|
|
Seeker.clear();
|
|
|
|
Spectator.clear();
|
|
|
|
customBoards.clear();
|
|
|
|
}
|
|
|
|
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class CustomBoard {
|
|
|
|
|
|
|
|
private final Scoreboard board;
|
|
|
|
private final Objective obj;
|
|
|
|
private final Player player;
|
|
|
|
private final Map<String,Line> LINES;
|
|
|
|
private int blanks;
|
|
|
|
private boolean displayed;
|
|
|
|
|
|
|
|
public CustomBoard(Player player, String title){
|
|
|
|
ScoreboardManager manager = Bukkit.getScoreboardManager();
|
|
|
|
assert manager != null;
|
|
|
|
this.board = manager.getNewScoreboard();
|
|
|
|
this.LINES = new HashMap<>();
|
|
|
|
this.player = player;
|
2022-04-11 16:36:11 +00:00
|
|
|
if(Version.atLeast("1.13")){
|
|
|
|
this.obj = board.registerNewObjective(
|
|
|
|
"Scoreboard", "dummy", ChatColor.translateAlternateColorCodes('&', title));
|
|
|
|
} else {
|
|
|
|
this.obj = board.registerNewObjective("Scoreboard", "dummy");
|
|
|
|
this.obj.setDisplayName(ChatColor.translateAlternateColorCodes('&', title));
|
|
|
|
}
|
2021-12-26 22:58:18 +00:00
|
|
|
this.blanks = 0;
|
|
|
|
this.displayed = false;
|
|
|
|
this.updateTeams();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void updateTeams() {
|
|
|
|
try{ board.registerNewTeam("Hider"); } catch (Exception ignored){}
|
|
|
|
try{ board.registerNewTeam("Seeker"); } catch (Exception ignored){}
|
|
|
|
Team hiderTeam = board.getTeam("Hider");
|
|
|
|
assert hiderTeam != null;
|
|
|
|
for(String entry : hiderTeam.getEntries())
|
|
|
|
hiderTeam.removeEntry(entry);
|
|
|
|
for(Player player : Board.getHiders())
|
|
|
|
hiderTeam.addEntry(player.getName());
|
|
|
|
Team seekerTeam = board.getTeam("Seeker");
|
|
|
|
assert seekerTeam != null;
|
|
|
|
for(String entry : seekerTeam.getEntries())
|
|
|
|
seekerTeam.removeEntry(entry);
|
|
|
|
for(Player player : Board.getSeekers())
|
|
|
|
seekerTeam.addEntry(player.getName());
|
2022-04-11 16:36:11 +00:00
|
|
|
if(Version.atLeast("1.9")){
|
|
|
|
if(nametagsVisible) {
|
|
|
|
hiderTeam.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.FOR_OWN_TEAM);
|
|
|
|
seekerTeam.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.FOR_OTHER_TEAMS);
|
|
|
|
} else {
|
|
|
|
hiderTeam.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
|
|
|
|
seekerTeam.setOption(Team.Option.NAME_TAG_VISIBILITY, Team.OptionStatus.NEVER);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(nametagsVisible) {
|
|
|
|
hiderTeam.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
|
|
|
|
seekerTeam.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OWN_TEAM);
|
|
|
|
} else {
|
|
|
|
hiderTeam.setNameTagVisibility(NameTagVisibility.NEVER);
|
|
|
|
seekerTeam.setNameTagVisibility(NameTagVisibility.NEVER);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(Version.atLeast("1.12")){
|
|
|
|
hiderTeam.setColor(ChatColor.GOLD);
|
|
|
|
seekerTeam.setColor(ChatColor.RED);
|
2021-12-26 22:58:18 +00:00
|
|
|
} else {
|
2022-04-11 16:36:11 +00:00
|
|
|
hiderTeam.setPrefix(ChatColor.translateAlternateColorCodes('&', "&6"));
|
|
|
|
seekerTeam.setPrefix(ChatColor.translateAlternateColorCodes('&', "&c"));
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLine(String key, String message){
|
|
|
|
Line line = LINES.get(key);
|
|
|
|
if(line == null)
|
2022-04-12 19:11:49 +00:00
|
|
|
addLine(key, ChatColor.translateAlternateColorCodes('&',message));
|
2021-12-26 22:58:18 +00:00
|
|
|
else
|
2022-04-12 19:11:49 +00:00
|
|
|
updateLine(key, ChatColor.translateAlternateColorCodes('&',message));
|
2021-12-26 22:58:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
private void addLine(String key, String message){
|
|
|
|
Score score = obj.getScore(message);
|
|
|
|
score.setScore(LINES.values().size()+1);
|
|
|
|
Line line = new Line(LINES.values().size()+1, message);
|
|
|
|
LINES.put(key, line);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void addBlank(){
|
|
|
|
if(displayed) return;
|
|
|
|
StringBuilder temp = new StringBuilder();
|
|
|
|
for(int i = 0; i <= blanks; i ++)
|
|
|
|
temp.append(ChatColor.RESET);
|
|
|
|
blanks++;
|
|
|
|
addLine("blank"+blanks, temp.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
private void updateLine(String key, String message){
|
|
|
|
Line line = LINES.get(key);
|
|
|
|
board.resetScores(line.getMessage());
|
|
|
|
line.setMessage(message);
|
|
|
|
Score newScore = obj.getScore(message);
|
|
|
|
|
|
|
|
newScore.setScore(line.getScore());
|
|
|
|
}
|
|
|
|
|
|
|
|
public void display() {
|
|
|
|
displayed = true;
|
|
|
|
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
|
|
|
|
player.setScoreboard(board);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
class Line {
|
|
|
|
|
|
|
|
private final int score;
|
|
|
|
private String message;
|
|
|
|
|
|
|
|
public Line(int score, String message){
|
|
|
|
this.score = score;
|
|
|
|
this.message = message;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getScore() {
|
|
|
|
return score;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getMessage() {
|
|
|
|
return message;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setMessage(String message) {
|
|
|
|
this.message = message;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|