mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-03-03 22:21:53 +07:00
Moved some engine consts to Riiablo class
This commit is contained in:
parent
b534fed719
commit
361158a481
@ -21,6 +21,11 @@ import com.riiablo.screen.GameScreen;
|
||||
public class Riiablo {
|
||||
private Riiablo() {}
|
||||
|
||||
public static final int MAX_DIFFS = 3;
|
||||
public static final int MAX_ACTS = 5;
|
||||
public static final int MAX_PLAYERS = 8;
|
||||
public static final int MAX_NAME_LENGTH = 15;
|
||||
|
||||
public static final int DESKTOP_VIEWPORT_HEIGHT = 480;
|
||||
public static final int MOBILE_VIEWPORT_HEIGHT = 360;
|
||||
public static final int DESKTOP_VIEWPORT_MIN_WIDTH = 640;
|
||||
|
@ -7,7 +7,6 @@ import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.utils.Array;
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.riiablo.Riiablo;
|
||||
import com.riiablo.engine.Engine;
|
||||
import com.riiablo.codec.util.BitStream;
|
||||
import com.riiablo.item.Item;
|
||||
import com.riiablo.item.Location;
|
||||
@ -179,7 +178,7 @@ public class D2S {
|
||||
size = slice.getInt();
|
||||
checksum = slice.getInt();
|
||||
alternate = slice.getInt();
|
||||
name = BufferUtils.readString2(slice, Engine.MAX_NAME_LENGTH + 1);
|
||||
name = BufferUtils.readString2(slice, Riiablo.MAX_NAME_LENGTH + 1);
|
||||
flags = slice.getInt();
|
||||
charClass = slice.get();
|
||||
unk1 = BufferUtils.readBytes(slice, 2);
|
||||
|
@ -115,9 +115,4 @@ public class Engine {
|
||||
//public static final byte MODE_GH = 18;
|
||||
//public static final byte MODE_GH = 19;
|
||||
}
|
||||
|
||||
public static final int MAX_DIFFS = 3;
|
||||
public static final int MAX_ACTS = 5;
|
||||
public static final int MAX_PLAYERS = 8;
|
||||
public static final int MAX_NAME_LENGTH = 15;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.badlogic.gdx.utils.ObjectMap;
|
||||
import com.riiablo.CharacterClass;
|
||||
import com.riiablo.Riiablo;
|
||||
import com.riiablo.engine.Engine;
|
||||
import com.riiablo.codec.DC6;
|
||||
import com.riiablo.codec.Index;
|
||||
import com.riiablo.codec.StringTBL;
|
||||
@ -192,7 +191,7 @@ public class Item extends Actor implements Disposable {
|
||||
socketsFilled = 0;
|
||||
qualityId = bitStream.readUnsigned7OrLess(3); // class
|
||||
qualityData = bitStream.readUnsigned7OrLess(7); // level
|
||||
inscription = bitStream.readString2(Engine.MAX_NAME_LENGTH + 1, 7); // name
|
||||
inscription = bitStream.readString2(Riiablo.MAX_NAME_LENGTH + 1, 7); // name
|
||||
} else {
|
||||
typeCode = bitStream.readString(4).trim();
|
||||
socketsFilled = bitStream.readUnsigned7OrLess(3);
|
||||
@ -295,7 +294,7 @@ public class Item extends Actor implements Disposable {
|
||||
}
|
||||
|
||||
if ((flags & INSCRIBED) == INSCRIBED) {
|
||||
inscription = bitStream.readString2(Engine.MAX_NAME_LENGTH + 1, 7);
|
||||
inscription = bitStream.readString2(Riiablo.MAX_NAME_LENGTH + 1, 7);
|
||||
}
|
||||
|
||||
bitStream.skip(1); // TODO: Unknown, this usually is 0, but is 1 on a Tome of Identify. (It's still 0 on a Tome of Townportal.)
|
||||
|
@ -90,7 +90,7 @@ public class D2GS extends ApplicationAdapter {
|
||||
private static final String TAG = "D2GS";
|
||||
|
||||
private static final int PORT = 6114;
|
||||
private static final int MAX_CLIENTS = Engine.MAX_PLAYERS;
|
||||
private static final int MAX_CLIENTS = Riiablo.MAX_PLAYERS;
|
||||
|
||||
public static void main(String[] args) {
|
||||
Options options = new Options()
|
||||
|
Loading…
Reference in New Issue
Block a user