mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-06 00:38:18 +00:00
Add tests for player actions
This commit is contained in:
@@ -2,6 +2,8 @@ package org.apollo.game.message.impl;
|
||||
|
||||
import org.apollo.net.message.Message;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A {@link Message} sent by the client to add an action to the menu when a player right-clicks another.
|
||||
*
|
||||
@@ -37,8 +39,8 @@ public final class SetPlayerActionMessage extends Message {
|
||||
/**
|
||||
* Creates the set player action message.
|
||||
*
|
||||
* @param text The action text.
|
||||
* @param slot The menu slot.
|
||||
* @param text The action text.
|
||||
* @param slot The menu slot.
|
||||
* @param primaryInteraction Whether or not the action is the primary action.
|
||||
*/
|
||||
public SetPlayerActionMessage(String text, int slot, boolean primaryInteraction) {
|
||||
@@ -75,4 +77,20 @@ public final class SetPlayerActionMessage extends Message {
|
||||
return primaryAction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o instanceof SetPlayerActionMessage) {
|
||||
SetPlayerActionMessage other = (SetPlayerActionMessage) o;
|
||||
return slot == other.slot && primaryAction == other.primaryAction && Objects.equals(text, other.text);
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(text, slot, primaryAction);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user