Skip to content

Commit

Permalink
feat: HSPacketUpdateMutual packet contains more information (#12)
Browse files Browse the repository at this point in the history
* feat: HSPacketUpdateMutual packet contains more information

* fix: Remove dominant type
  • Loading branch information
kristofbolyai authored Nov 1, 2022
1 parent 378d2e1 commit 2dbc939
Showing 1 changed file with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ public class HSPacketUpdateMutual implements HadesPacket<IHadesClientAdapter> {
float x, y, z;
int health, mana;
int maxHealth, maxMana;
RelationType relationType;
boolean isPartyMember;
boolean isMutualFriend;
boolean isGuildMember;

public HSPacketUpdateMutual() { }

public HSPacketUpdateMutual(UUID user, String name, float x, float y, float z, int health, int maxHealth, int mana, int maxMana, RelationType relationType) {
public HSPacketUpdateMutual(UUID user, String name, float x, float y, float z, int health, int maxHealth, int mana, int maxMana, boolean isPartyMember, boolean isMutualFriend, boolean isGuildMember) {
this.user = user;
this.name = name;
this.x = x;
Expand All @@ -30,7 +32,9 @@ public HSPacketUpdateMutual(UUID user, String name, float x, float y, float z, i
this.maxHealth = maxHealth;
this.mana = mana;
this.maxMana = maxMana;
this.relationType = relationType;
this.isPartyMember = isPartyMember;
this.isMutualFriend = isMutualFriend;
this.isGuildMember = isGuildMember;
}

public UUID getUser() {
Expand Down Expand Up @@ -69,8 +73,16 @@ public int getMaxMana() {
return maxMana;
}

public RelationType getRelationType() {
return relationType;
public boolean isPartyMember() {
return isPartyMember;
}

public boolean isMutualFriend() {
return isMutualFriend;
}

public boolean isGuildMember() {
return isGuildMember;
}

@Override
Expand All @@ -84,7 +96,9 @@ public void readData(HadesBuffer buffer) {
maxHealth = buffer.readInt();
mana = buffer.readInt();
maxMana = buffer.readInt();
relationType = buffer.readEnum(RelationType.class);
isPartyMember = buffer.readBoolean();
isMutualFriend = buffer.readBoolean();
isGuildMember = buffer.readBoolean();
}

@Override
Expand All @@ -98,7 +112,9 @@ public void writeData(HadesBuffer buffer) {
buffer.writeInt(maxHealth);
buffer.writeInt(mana);
buffer.writeInt(maxMana);
buffer.writeEnum(relationType);
buffer.writeBoolean(isPartyMember);
buffer.writeBoolean(isMutualFriend);
buffer.writeBoolean(isGuildMember);
}

@Override
Expand Down

0 comments on commit 2dbc939

Please sign in to comment.