mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-06 00:08:19 +07:00
Changed D2SReader into a singleton
This commit is contained in:
@ -9,7 +9,9 @@ import com.riiablo.item.ItemReader;
|
|||||||
import com.riiablo.log.Log;
|
import com.riiablo.log.Log;
|
||||||
import com.riiablo.log.LogManager;
|
import com.riiablo.log.LogManager;
|
||||||
|
|
||||||
public class D2SReader {
|
public enum D2SReader {
|
||||||
|
INSTANCE;
|
||||||
|
|
||||||
private static final Logger log = LogManager.getLogger(D2SReader.class);
|
private static final Logger log = LogManager.getLogger(D2SReader.class);
|
||||||
|
|
||||||
public D2S readD2S(ByteInput in) {
|
public D2S readD2S(ByteInput in) {
|
||||||
|
@ -44,7 +44,7 @@ public class D2SReaderTool extends ApplicationAdapter {
|
|||||||
Riiablo.string = new StringTBLs(Riiablo.mpqs);
|
Riiablo.string = new StringTBLs(Riiablo.mpqs);
|
||||||
|
|
||||||
ItemReader itemReader = new ItemReader();
|
ItemReader itemReader = new ItemReader();
|
||||||
D2SReader serializer = new D2SReader();
|
D2SReader serializer = D2SReader.INSTANCE;
|
||||||
for (String d2ss0 : d2ss) {
|
for (String d2ss0 : d2ss) {
|
||||||
FileHandle handle = Riiablo.home.child("Save/" + d2ss0 + '.' + D2S.EXT);
|
FileHandle handle = Riiablo.home.child("Save/" + d2ss0 + '.' + D2S.EXT);
|
||||||
ByteInput byteInput = ByteInput.wrap(handle.readBytes());
|
ByteInput byteInput = ByteInput.wrap(handle.readBytes());
|
||||||
|
Reference in New Issue
Block a user