1package com.runehive.game.world.entity.mob.player.exchange;
3import com.runehive.net.packet.out.SendMessage;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.util.MessageColor;
7import java.util.ArrayList;
9import java.util.Optional;
80 if(!session.isPresent()) {
84 session.get().forEach(p -> {
87 p.interfaceManager.close();
101 if(!session.isPresent()) {
105 reset(session.get().type);
113 player.exchangeSession.requested_players.clear();
This class represents a character controlled by a player.
void send(OutgoingPacket encoder)
final boolean add(Player player, int slot, int amount)
Attempts to deposit an item to the container.
static Optional< ExchangeSession > getSession(Player player)
Gets the session if applicable the player is in.
static final Set< ExchangeSession > SESSIONS
The collection of sessions.
boolean request()
Attempts to start an exchange session.
final boolean remove(Player player, int slot, int amount)
Attempts to withdraw an item from the container.
final List< Player > requested_players
The players this player has requested.
boolean withdraw(int slot, int amount)
Attempts to withdraw an item from the exchange session.
void resetRequests()
Clears the list of requested players.
boolean deposit(int slot, int amount)
Attempts to deposit an item to an exchange session.
ExchangeSessionManager(Player player)
Constructs a new ExchangeSessionManager.
final Player player
The player this manager is for.
boolean request(ExchangeSession session)
Attempts to request the specified session.
boolean reset()
Resets all the sessions the player is in regardless of the session state.
void reset(ExchangeSessionType type)
Resets all the session for the player dependant on the type.
The OutgoingPacket that sends a message to a Players chatbox in the client.
RESTORE
Determines the items should be restored to the belonging owners.
Holds an enum of colors for ease.