mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 00:40:52 +01:00
Fix GuildMember Comparable
This commit is contained in:
parent
694a70cf20
commit
1db8ff2118
@ -3,9 +3,9 @@ package com.eu.habbo.habbohotel.guilds;
|
|||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
public class GuildMember implements Comparable {
|
public class GuildMember implements Comparable<GuildMember> {
|
||||||
private int userId;
|
private final int userId;
|
||||||
private String username;
|
private final String username;
|
||||||
private String look;
|
private String look;
|
||||||
private int joinDate;
|
private int joinDate;
|
||||||
private GuildRank rank;
|
private GuildRank rank;
|
||||||
@ -59,10 +59,20 @@ public class GuildMember implements Comparable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(Object o) {
|
public int compareTo(GuildMember o) {
|
||||||
return 0;
|
return this.userId - o.userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (o instanceof GuildMember) {
|
||||||
|
return ((GuildMember) o).userId == this.userId && ((GuildMember) o).joinDate == this.joinDate && ((GuildMember) o).rank == this.rank;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public GuildMembershipStatus getMembershipStatus() {
|
public GuildMembershipStatus getMembershipStatus() {
|
||||||
if (this.rank == GuildRank.DELETED) return GuildMembershipStatus.NOT_MEMBER;
|
if (this.rank == GuildRank.DELETED) return GuildMembershipStatus.NOT_MEMBER;
|
||||||
if (this.rank == GuildRank.OWNER || this.rank == GuildRank.ADMIN || this.rank == GuildRank.MEMBER) return GuildMembershipStatus.MEMBER;
|
if (this.rank == GuildRank.OWNER || this.rank == GuildRank.ADMIN || this.rank == GuildRank.MEMBER) return GuildMembershipStatus.MEMBER;
|
||||||
|
Loading…
Reference in New Issue
Block a user