mooore stuff
Some checks failed
Linux arm64 / Build (push) Failing after 5m5s

This commit is contained in:
2025-01-26 13:46:23 +01:00
parent caf7011f08
commit e51cc23459
20 changed files with 395 additions and 65 deletions

View File

@@ -0,0 +1,30 @@
package game;
import java.util.HashMap;
import java.util.Map;
public class Game {
private final Map<Integer, Player> players;
public Game() {
this.players = new HashMap<>();
}
public Player getPlayerById(int id) {
return players.get(id);
}
public void addPlayer(Player player) {
players.put(player.getId(), player);
}
public void removePlayer(int id) {
players.remove(id);
}
public Map<Integer, Player> getPlayers() {
return players;
}
}

View File

@@ -0,0 +1,25 @@
package game;
import java.io.Serializable;
public class Player implements Serializable {
static private final long serialVersionUID = 9999;
private final String pseudo;
private final int id;
public Player(int id, String pseudo) {
this.pseudo = pseudo;
this.id = id;
}
public String getPseudo() {
return this.pseudo;
}
public int getId() {
return this.id;
}
}