Changed D2SReader into a singleton

This commit is contained in:
Collin Smith
2020-08-16 01:04:52 -07:00
parent 4af5aac494
commit 97a3265e05
2 changed files with 4 additions and 2 deletions

View File

@ -9,7 +9,9 @@ import com.riiablo.item.ItemReader;
import com.riiablo.log.Log;
import com.riiablo.log.LogManager;
public class D2SReader {
public enum D2SReader {
INSTANCE;
private static final Logger log = LogManager.getLogger(D2SReader.class);
public D2S readD2S(ByteInput in) {

View File

@ -44,7 +44,7 @@ public class D2SReaderTool extends ApplicationAdapter {
Riiablo.string = new StringTBLs(Riiablo.mpqs);
ItemReader itemReader = new ItemReader();
D2SReader serializer = new D2SReader();
D2SReader serializer = D2SReader.INSTANCE;
for (String d2ss0 : d2ss) {
FileHandle handle = Riiablo.home.child("Save/" + d2ss0 + '.' + D2S.EXT);
ByteInput byteInput = ByteInput.wrap(handle.readBytes());