mirror of
https://github.com/Auties00/Reboot-Launcher.git
synced 2026-01-14 03:32:23 +01:00
Initial commit
This commit is contained in:
39
lib/src/model/fortnite_version.dart
Normal file
39
lib/src/model/fortnite_version.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
import 'dart:io';
|
||||
|
||||
class FortniteVersion {
|
||||
String name;
|
||||
Directory location;
|
||||
|
||||
FortniteVersion.fromJson(json)
|
||||
: name = json["name"],
|
||||
location = Directory(json["location"]);
|
||||
|
||||
FortniteVersion({required this.name, required this.location});
|
||||
|
||||
static File findExecutable(Directory directory, String name) {
|
||||
return File(
|
||||
"${directory.path}/FortniteGame/Binaries/Win64/$name");
|
||||
}
|
||||
|
||||
File get executable {
|
||||
return findExecutable(location, "FortniteClient-Win64-Shipping.exe");
|
||||
}
|
||||
|
||||
File get launcher {
|
||||
return findExecutable(location, "FortniteLauncher.exe");
|
||||
}
|
||||
|
||||
File get eacExecutable {
|
||||
return findExecutable(location, "FortniteClient-Win64-Shipping_EAC.exe");
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'name': name,
|
||||
'location': location.path,
|
||||
};
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'FortniteVersion{name: $name, location: $location}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user