Skip to content

Commit

Permalink
Minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MikolajKolek committed Mar 31, 2021
1 parent 8f8eeb4 commit b7612a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Assets/Scripts/GameScene1/LevelRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ public static void InitializeLevelList() {
levelMap[levelHeight - i - 1] = levelRow;
}
}

var level = new Level(id, levelName, time, difficulty, boxCount, levelWidth, levelHeight, levelMap);
Registry.Add(level);
fileReader.Close();
}

Registry.Sort();
Expand Down
5 changes: 3 additions & 2 deletions Assets/Scripts/GameScene3/LevelRegistry2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public static void InitializeLevelList(TileBase boxOnBoxArea, TileBase boxArea,
LevelRegistry2.wall = wall;
LevelRegistry2.box = box;
LevelRegistry2.empty = empty;

var directory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
@"\Sokoban\levels";
if (!Directory.Exists(directory))
Directory.CreateDirectory(directory);
var files = Directory.GetFiles(directory, "*.txt");

foreach (var file in files) {
var fileReader = new StreamReader(file);
var id = Convert.ToInt32(ProcessLine(fileReader.ReadLine()));
Expand Down Expand Up @@ -104,6 +104,7 @@ public static void InitializeLevelList(TileBase boxOnBoxArea, TileBase boxArea,
var level = new Level(id, levelName, 0, Level.Difficulty.None, boxCount, levelWidth, levelHeight,
levelMap);
Registry.Add(level);
fileReader.Close();
}

Registry.Sort();
Expand Down
2 changes: 1 addition & 1 deletion Assets/StreamingAssets/build_info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Build from DESKTOP-7NTI7HV at 31.03.2021 10:47:34
Build from DESKTOP-7NTI7HV at 31.03.2021 23:00:39

0 comments on commit b7612a8

Please sign in to comment.