mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 16:49:12 +00:00
Add warnings about consistent element ordering; Use ordinal where possible.
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
package org.apollo.game.model.settings;
|
package org.apollo.game.model.settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumeration containing the two genders (male and female).
|
* An enumeration containing the two genders (male and female). This enumeration relies on the ordering of the elements
|
||||||
|
* within, which should be as follows: {@code MALE}, {@code FEMALE}.
|
||||||
*
|
*
|
||||||
* @author Graham
|
* @author Graham
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package org.apollo.game.model.settings;
|
package org.apollo.game.model.settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumeration representing the different privacy states for public, private and trade chat.
|
* An enumeration representing the different privacy states for public, private and trade chat. This enumeration relies
|
||||||
|
* on the ordering of the elements within, which should be as follows: {@code ON}, {@code HIDE}, {@code FRIENDS},
|
||||||
|
* {@code OFF}, {@code FILTERABLE}.
|
||||||
*
|
*
|
||||||
* @author Kyle Stevenson
|
* @author Kyle Stevenson
|
||||||
*/
|
*/
|
||||||
@@ -29,7 +31,8 @@ public enum PrivacyState {
|
|||||||
OFF(3),
|
OFF(3),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the 'filterable' state - a custom state that filters 'unnecessary' server messages.
|
* Represents the 'filterable' state - a custom state that filters 'unnecessary' server messages. This state only
|
||||||
|
* applies to public chat.
|
||||||
*/
|
*/
|
||||||
FILTERABLE(4);
|
FILTERABLE(4);
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
package org.apollo.game.model.settings;
|
package org.apollo.game.model.settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumeration with the different privilege levels a player can have.
|
* An enumeration with the different privilege levels a player can have. This enumeration relies on the ordering of the
|
||||||
|
* elements within, which should be as follows: {@code STANDARD}, {@code MODERATOR}, {@code ADMINISTRATOR}.
|
||||||
*
|
*
|
||||||
* @author Graham
|
* @author Graham
|
||||||
*/
|
*/
|
||||||
@@ -10,17 +11,17 @@ public enum PrivilegeLevel {
|
|||||||
/**
|
/**
|
||||||
* A standard (rights 0) account.
|
* A standard (rights 0) account.
|
||||||
*/
|
*/
|
||||||
STANDARD(0),
|
STANDARD,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A player moderator (rights 1) account.
|
* A player moderator (rights 1) account.
|
||||||
*/
|
*/
|
||||||
MODERATOR(1),
|
MODERATOR,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An administrator (rights 2) account.
|
* An administrator (rights 2) account.
|
||||||
*/
|
*/
|
||||||
ADMINISTRATOR(2);
|
ADMINISTRATOR;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the privilege level for the specified numerical value.
|
* Gets the privilege level for the specified numerical value.
|
||||||
@@ -38,26 +39,12 @@ public enum PrivilegeLevel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The numerical level used in the protocol.
|
* Gets the numerical value of this privilege level.
|
||||||
*/
|
|
||||||
private final int value;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the privilege level.
|
|
||||||
*
|
*
|
||||||
* @param value The numerical level.
|
* @return The numerical value used in the protocol.
|
||||||
*/
|
|
||||||
private PrivilegeLevel(int value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the numerical level.
|
|
||||||
*
|
|
||||||
* @return The numerical level used in the protocol.
|
|
||||||
*/
|
*/
|
||||||
public int toInteger() {
|
public int toInteger() {
|
||||||
return value;
|
return ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
package org.apollo.game.model.settings;
|
package org.apollo.game.model.settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enumeration representing
|
* An enumeration representing the brightness of a player's screen. This enumeration relies on the ordering of the
|
||||||
|
* elements within, which should be as follows: {@code DARK}, {@code NORMAL}, {@code BRIGHT}, {@code VERY_BRIGHT}.
|
||||||
*
|
*
|
||||||
* @author Major
|
* @author Major
|
||||||
*/
|
*/
|
||||||
@@ -10,22 +11,22 @@ public enum ScreenBrightness {
|
|||||||
/**
|
/**
|
||||||
* Represents the 'dark' screen brightness.
|
* Represents the 'dark' screen brightness.
|
||||||
*/
|
*/
|
||||||
DARK(0),
|
DARK,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the 'normal' screen brightness.
|
* Represents the 'normal' screen brightness.
|
||||||
*/
|
*/
|
||||||
NORMAL(1),
|
NORMAL,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the 'bright' screen brightness.
|
* Represents the 'bright' screen brightness.
|
||||||
*/
|
*/
|
||||||
BRIGHT(2),
|
BRIGHT,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the 'very bright' screen brightness.
|
* Represents the 'very bright' screen brightness.
|
||||||
*/
|
*/
|
||||||
VERY_BRIGHT(3);
|
VERY_BRIGHT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the screen brightness for the specified numerical value.
|
* Gets the screen brightness for the specified numerical value.
|
||||||
@@ -42,27 +43,13 @@ public enum ScreenBrightness {
|
|||||||
return values[value];
|
return values[value];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The numerical value of this brightness.
|
|
||||||
*/
|
|
||||||
private final int value;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the screen brightness.
|
|
||||||
*
|
|
||||||
* @param value The numerical value.
|
|
||||||
*/
|
|
||||||
private ScreenBrightness(int value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts this screen brightness to an integer.
|
* Converts this screen brightness to an integer.
|
||||||
*
|
*
|
||||||
* @return The numerical value.
|
* @return The numerical value.
|
||||||
*/
|
*/
|
||||||
public int toInteger() {
|
public int toInteger() {
|
||||||
return value;
|
return ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
package org.apollo.game.model.settings;
|
package org.apollo.game.model.settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the status of the friend server.
|
* Represents the status of the friend server. This enumeration relies on the ordering of the elements within, which
|
||||||
|
* should be as follows: {@code OFFLINE}, {@code CONNECTING}, {@code ONLINE}.
|
||||||
*
|
*
|
||||||
* @author Major
|
* @author Major
|
||||||
*/
|
*/
|
||||||
@@ -10,31 +11,17 @@ public enum ServerStatus {
|
|||||||
/**
|
/**
|
||||||
* Indicates the friend server is offline.
|
* Indicates the friend server is offline.
|
||||||
*/
|
*/
|
||||||
OFFLINE(0),
|
OFFLINE,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates the friend server is being connected to.
|
* Indicates the friend server is being connected to.
|
||||||
*/
|
*/
|
||||||
CONNECTING(1),
|
CONNECTING,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates the friend server is online and connected.
|
* Indicates the friend server is online and connected.
|
||||||
*/
|
*/
|
||||||
ONLINE(2);
|
ONLINE;
|
||||||
|
|
||||||
/**
|
|
||||||
* The code of the server status.
|
|
||||||
*/
|
|
||||||
private final int code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new server status.
|
|
||||||
*
|
|
||||||
* @param code The code.
|
|
||||||
*/
|
|
||||||
private ServerStatus(int code) {
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the code of this server status.
|
* Gets the code of this server status.
|
||||||
@@ -42,7 +29,7 @@ public enum ServerStatus {
|
|||||||
* @return The code.
|
* @return The code.
|
||||||
*/
|
*/
|
||||||
public int getCode() {
|
public int getCode() {
|
||||||
return code;
|
return ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user