Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LocalPlayer
- {
- private final UUID uuid;
- private final String nickname;
- private boolean god;
- private boolean costam;
- private int points;
- public LocalPlayer(UUID uuid, String nickname, boolean god, boolean costam, int points)
- {
- this.uuid = uuid;
- // to samo dla reszty
- }
- public UUID getUUID() // to samo dla reszty + dla boolean np zamiast getGod robisz isGod lub hasGod
- {
- return uuid;
- }
- public void setGod(boolean god) //to samo dla reszty
- {
- this.god = god;
- }
- // + możesz dodawać takie wygodne metody:
- public void addPoints(int points)
- {
- this.points += points;
- }
- + metoda equals i hashcode sprawdzająca tylko UUID bo każdy ma inne, ale to wystraczy wygenerować w eclipse/intellij czy co tam masz, każdy program ma metode do ich generowania.
- Tak samo jak ma metody do generowanie tych "getterów" i "setterów"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement