57 lines
1.4 KiB
Java
57 lines
1.4 KiB
Java
/*
|
|
* Copyright (c) 2017 univento.eu - All rights reserved
|
|
* You are not allowed to use, distribute or modify this code
|
|
*/
|
|
|
|
package eu.univento.commons.player.party;
|
|
|
|
import eu.univento.commons.player.DatabasePlayer;
|
|
import lombok.Getter;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 1.0
|
|
*/
|
|
|
|
@Getter
|
|
public class Party {
|
|
|
|
//TODO: more stuff to add here
|
|
|
|
private DatabasePlayer owner;
|
|
private List<DatabasePlayer> members;
|
|
private List<DatabasePlayer> invitations;
|
|
|
|
public Party(DatabasePlayer owner, List<DatabasePlayer> members, List<DatabasePlayer> invitations) {
|
|
this.owner = owner;
|
|
|
|
if(members == null) this.members = new ArrayList<>();
|
|
else this.members = members;
|
|
|
|
if(invitations == null )this.invitations = new ArrayList<>();
|
|
else this.invitations = invitations;
|
|
}
|
|
|
|
public boolean addMember(DatabasePlayer player) {
|
|
return !members.contains(player) && members.add(player);
|
|
}
|
|
|
|
public boolean removeMember(DatabasePlayer player) {
|
|
return members.contains(player) && members.remove(player);
|
|
}
|
|
|
|
public boolean addInvite(DatabasePlayer player) {
|
|
return !invitations.contains(player) && invitations.add(player);
|
|
}
|
|
|
|
public boolean removeInvite(DatabasePlayer player) {
|
|
return invitations.contains(player) && invitations.remove(player);
|
|
}
|
|
|
|
public void leave(DatabasePlayer player) {
|
|
|
|
}
|
|
} |