1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-09 08:52:51 +00:00

Completed documentation

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-14 13:27:28 -03:00
parent e9c6f1b027
commit 4b9d52e724
56 changed files with 716 additions and 26 deletions

View File

@@ -0,0 +1,49 @@
package com.l2jserver.game;
/**
* Represents the protocol version used by the client
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public enum ProtocolVersion {
/**
* Release version
*/
RELEASE(0),
/**
* Freya(216)
*/
FREYA(216, RELEASE),
/**
* High5(217)
*/
HIGH5(217, FREYA);
public final ProtocolVersion parent;
public final int version;
ProtocolVersion(int version) {
this(version, null);
}
ProtocolVersion(int version, ProtocolVersion parent) {
this.version = version;
this.parent = parent;
}
public boolean supports(ProtocolVersion version) {
if (this == version)
return true;
if (this.parent == null)
return false;
return this.parent.supports(version);
}
public static ProtocolVersion fromVersion(int version) {
for (ProtocolVersion v : values()) {
if (v.version == version)
return v;
}
return null;
}
}