Changed PartyUser to be ChatUser
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
package com.alttd.chat.objects;
|
||||
|
||||
import com.alttd.chat.database.Queries;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class ChatUser {
|
||||
private final UUID uuid;
|
||||
private final int partyId;
|
||||
private boolean toggledChat;
|
||||
private boolean forceTp;
|
||||
private String displayName;
|
||||
private String prefix;
|
||||
private String staffPrefix;
|
||||
private String prefixAll;
|
||||
private boolean toggleGc;
|
||||
|
||||
public ChatUser(UUID uuid, int partyId, boolean toggled_chat, boolean force_tp) {
|
||||
this.uuid = uuid;
|
||||
this.partyId = partyId;
|
||||
this.toggledChat = toggled_chat;
|
||||
this.forceTp = force_tp;
|
||||
|
||||
//TODO Get the user somehow and use that to check their prefixes
|
||||
displayName = Queries.getNickname(uuid);
|
||||
if (displayName == null) {
|
||||
//TODO displayName = player.getName() or something
|
||||
}
|
||||
|
||||
//TODO Get the user somehow and use that to check the toggleGc permission
|
||||
}
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public int getPartyId() {
|
||||
return partyId;
|
||||
}
|
||||
|
||||
public boolean toggledChat() {
|
||||
return toggledChat;
|
||||
}
|
||||
|
||||
public void toggleChat() {
|
||||
toggledChat = !toggledChat;
|
||||
Queries.setChatState(toggledChat, uuid); //TODO: Async pls
|
||||
}
|
||||
|
||||
public boolean ForceTp() {
|
||||
return forceTp;
|
||||
}
|
||||
|
||||
public void toggleForceTp() {
|
||||
forceTp = !forceTp;
|
||||
Queries.setForceTpState(forceTp, uuid); //TODO: Async pls
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getPrefix() {
|
||||
return prefix;
|
||||
}
|
||||
|
||||
public void setPrefix(String prefix) {
|
||||
this.prefix = prefix;
|
||||
}
|
||||
|
||||
public String getStaffPrefix() {
|
||||
return staffPrefix;
|
||||
}
|
||||
|
||||
public void setStaffPrefix(String staffPrefix) {
|
||||
this.staffPrefix = staffPrefix;
|
||||
}
|
||||
|
||||
public String getPrefixAll() {
|
||||
return prefixAll;
|
||||
}
|
||||
|
||||
public void setPrefixAll(String prefixAll) {
|
||||
this.prefixAll = prefixAll;
|
||||
}
|
||||
|
||||
public void toggleGc() {
|
||||
toggleGc = !toggleGc;
|
||||
}
|
||||
|
||||
public boolean isGcOn() {
|
||||
return toggleGc;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public class Party {
|
||||
private UUID ownerUuid;
|
||||
private String partyName;
|
||||
private String partyPassword;
|
||||
private ArrayList<PartyUser> partyUsers; //TODO might need to be a map?
|
||||
private ArrayList<ChatUser> partyUsers; //TODO might need to be a map?
|
||||
|
||||
public Party(int partyId, UUID ownerUuid, String partyName, String partyPassword) {
|
||||
this.partyId = partyId;
|
||||
@@ -21,16 +21,16 @@ public class Party {
|
||||
partyUsers = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void addUser(ArrayList<PartyUser> partyUsers) {
|
||||
public void addUser(ArrayList<ChatUser> partyUsers) {
|
||||
this.partyUsers.addAll(partyUsers);
|
||||
}
|
||||
|
||||
public void addUser(PartyUser partyUser) {
|
||||
public void addUser(ChatUser partyUser) {
|
||||
this.partyUsers.add(partyUser);
|
||||
Queries.addUser(partyUser);
|
||||
}
|
||||
|
||||
public void removeUser(PartyUser partyUser) {
|
||||
public void removeUser(ChatUser partyUser) {
|
||||
partyUsers.remove(partyUser);
|
||||
Queries.removeUser(partyUser.getUuid());
|
||||
}
|
||||
@@ -70,11 +70,11 @@ public class Party {
|
||||
return !partyPassword.isEmpty();
|
||||
}
|
||||
|
||||
public ArrayList<PartyUser> getPartyUsers() {
|
||||
public ArrayList<ChatUser> getPartyUsers() {
|
||||
return partyUsers;
|
||||
}
|
||||
|
||||
public void setPartyUsers(ArrayList<PartyUser> partyUsers) {
|
||||
public void setPartyUsers(ArrayList<ChatUser> partyUsers) {
|
||||
this.partyUsers = partyUsers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package com.alttd.chat.objects;
|
||||
|
||||
import com.alttd.chat.database.Queries;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class PartyUser {
|
||||
private final UUID uuid;
|
||||
private final int partyId;
|
||||
private boolean toggledChat;
|
||||
private boolean forceTp;
|
||||
|
||||
public PartyUser(UUID uuid, int partyId, boolean toggled_chat, boolean force_tp) {
|
||||
this.uuid = uuid;
|
||||
this.partyId = partyId;
|
||||
this.toggledChat = toggled_chat;
|
||||
this.forceTp = force_tp;
|
||||
}
|
||||
|
||||
public UUID getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public int getPartyId() {
|
||||
return partyId;
|
||||
}
|
||||
|
||||
public boolean toggledChat() {
|
||||
return toggledChat;
|
||||
}
|
||||
|
||||
public void toggleChat() {
|
||||
toggledChat = !toggledChat;
|
||||
Queries.setChatState(toggledChat, uuid); //TODO: Async pls
|
||||
}
|
||||
|
||||
public boolean ForceTp() {
|
||||
return forceTp;
|
||||
}
|
||||
|
||||
public void toggleForceTp() {
|
||||
forceTp = !forceTp;
|
||||
Queries.setForceTpState(forceTp, uuid); //TODO: Async pls
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user