Skip to content

Commit

Permalink
Mounted -> Mounted<?>
Browse files Browse the repository at this point in the history
  • Loading branch information
rjhancock committed Sep 9, 2024
1 parent 71aa1a3 commit 1fb20a0
Show file tree
Hide file tree
Showing 278 changed files with 26,170 additions and 28,387 deletions.
41 changes: 29 additions & 12 deletions megamek/src/megamek/client/AbstractClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ public abstract class AbstractClient implements IClient {

protected final UnitNameTracker unitNameTracker = new UnitNameTracker();

/** The bots controlled by the local player; maps a bot's name String to a bot's client. */
/**
* The bots controlled by the local player; maps a bot's name String to a bot's
* client.
*/
protected Map<String, AbstractClient> bots = new TreeMap<>(String::compareTo);

// Image cache for storing unit icons in as base64 with the unit ID as key
Expand Down Expand Up @@ -183,7 +186,8 @@ protected void initGameLog() {

/**
* Called to determine whether the game log should be kept.
* Default implementation delegates to {@code PreferenceManager.getClientPreferences()}.
* Default implementation delegates to
* {@code PreferenceManager.getClientPreferences()}.
*/
protected boolean keepGameLog() {
return PreferenceManager.getClientPreferences().keepGameLog();
Expand Down Expand Up @@ -236,7 +240,10 @@ protected void receivePlayerInfo(Packet c) {
}
}

/** Sends the packet to the server, if this client is connected. Otherwise, does nothing. */
/**
* Sends the packet to the server, if this client is connected. Otherwise, does
* nothing.
*/
protected void send(Packet packet) {
if (connection != null) {
connection.send(packet);
Expand All @@ -256,8 +263,10 @@ protected void flushConn() {
}

/**
* Perform a dump of the current memory usage. This method is useful in tracking performance issues
* on various player's systems. You can activate it by changing the "memorydumpon" setting to
* Perform a dump of the current memory usage. This method is useful in tracking
* performance issues
* on various player's systems. You can activate it by changing the
* "memorydumpon" setting to
* "true" in the clientsettings.xml file.
*
* @param where A String indicating which part of the game is making this call.
Expand Down Expand Up @@ -326,15 +335,16 @@ protected void receiveUnitReplace(Packet packet) {
* This is used by external programs running megamek
*
* @param l
* the game listener.
* the game listener.
*/
@SuppressWarnings("unused")
public void addCloseClientListener(CloseClientListener l) {
closeClientListeners.addElement(l);
}

/**
* This method is the starting point that handles all received Packets. This method should only
* This method is the starting point that handles all received Packets. This
* method should only
* be overriden in very special cases such as in Princess to call Precognition.
*
* @param packet The packet to handle
Expand All @@ -346,7 +356,8 @@ protected void handlePacket(Packet packet) {
}
try {
if (packet.getCommand() == PacketCommand.MULTI_PACKET) {
//TODO gather any fired events and fire them only at the end of the packets, possibly only for SBF
// TODO gather any fired events and fire them only at the end of the packets,
// possibly only for SBF
@SuppressWarnings("unchecked")
var includedPackets = (List<Packet>) packet.getObject(0);
for (Packet includedPacket : includedPackets) {
Expand All @@ -365,11 +376,15 @@ protected void handlePacket(Packet packet) {
}

/**
* Handles any Packets that are specific to the game type (TW, AS...). When implementing this,
* make sure that this doesn't do duplicate actions with {@link #handleGameIndependentPacket(Packet)}
* - but packets may be handled in both methods (all packets traverse both methods).
* Handles any Packets that are specific to the game type (TW, AS...). When
* implementing this,
* make sure that this doesn't do duplicate actions with
* {@link #handleGameIndependentPacket(Packet)}
* - but packets may be handled in both methods (all packets traverse both
* methods).
*
* When making changes, do not forget to update Precognition which is a Client clone but unfortunately
* When making changes, do not forget to update Precognition which is a Client
* clone but unfortunately
* not a subclass.
*
* @param packet The packet to handle
Expand Down Expand Up @@ -494,6 +509,8 @@ public void changePhase(GamePhase phase) {
unitNameTracker.clear();
}
break;
default:
break;
}
}

Expand Down
Loading

0 comments on commit 1fb20a0

Please sign in to comment.