Skip to content

Commit 974fbb0

Browse files
committed
Changed mission file load to stream.
1 parent 97f5bb6 commit 974fbb0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/Save.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import java.util.*;
33

44
public class Save {
5-
public void loadSave(File loadPath){
5+
public void loadSave(InputStream loadPath){
66
try{
77
Scanner loadScanner = new Scanner(loadPath);
88

@@ -20,7 +20,7 @@ public void loadSave(File loadPath){
2020

2121
}
2222
loadScanner.close();
23-
} catch(Exception e){}
23+
} catch(Exception e){System.out.println(e.getMessage());}
2424

2525

2626
}

src/Screen.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ public void define(){
7676

7777

7878
ClassLoader classLoader = getClass().getClassLoader();
79-
File file = new File(classLoader.getResource("Mission").getFile());
80-
save.loadSave(file);
79+
InputStream stream = classLoader.getResourceAsStream("Mission");
80+
81+
save.loadSave(stream);
8182

8283
for(int i =0; i< mobs.length;i++){
8384
mobs[i] = new Mob();

0 commit comments

Comments
 (0)