31 /** |
31 /** |
32 * Application directory layout. |
32 * Application directory layout. |
33 */ |
33 */ |
34 final class ApplicationLayout implements PathGroup.Facade<ApplicationLayout> { |
34 final class ApplicationLayout implements PathGroup.Facade<ApplicationLayout> { |
35 enum PathRole { |
35 enum PathRole { |
36 RUNTIME, APP, LAUNCHERS_DIR, DESKTOP |
36 RUNTIME, APP, LAUNCHERS, DESKTOP, APP_MODS, DLLS |
37 } |
37 } |
38 |
38 |
39 ApplicationLayout(Map<Object, Path> paths) { |
39 ApplicationLayout(Map<Object, Path> paths) { |
40 data = new PathGroup(paths); |
40 data = new PathGroup(paths); |
41 } |
41 } |
74 Path runtimeDirectory() { |
81 Path runtimeDirectory() { |
75 return pathGroup().getPath(PathRole.RUNTIME); |
82 return pathGroup().getPath(PathRole.RUNTIME); |
76 } |
83 } |
77 |
84 |
78 /** |
85 /** |
|
86 * Path to application mods directory. |
|
87 */ |
|
88 Path appModsDirectory() { |
|
89 return pathGroup().getPath(PathRole.APP_MODS); |
|
90 } |
|
91 |
|
92 /** |
79 * Path to directory with application's desktop integration files. |
93 * Path to directory with application's desktop integration files. |
80 */ |
94 */ |
81 Path destktopIntegrationDirectory() { |
95 Path destktopIntegrationDirectory() { |
82 return pathGroup().getPath(PathRole.DESKTOP); |
96 return pathGroup().getPath(PathRole.DESKTOP); |
83 } |
97 } |
84 |
98 |
85 static ApplicationLayout unixApp() { |
99 static ApplicationLayout linuxApp() { |
86 return new ApplicationLayout(Map.of( |
100 return new ApplicationLayout(Map.of( |
87 PathRole.LAUNCHERS_DIR, Path.of("bin"), |
101 PathRole.LAUNCHERS, Path.of("bin"), |
88 PathRole.APP, Path.of("app"), |
102 PathRole.APP, Path.of("lib/app"), |
89 PathRole.RUNTIME, Path.of("runtime"), |
103 PathRole.RUNTIME, Path.of("lib/runtime"), |
90 PathRole.DESKTOP, Path.of("bin") |
104 PathRole.DESKTOP, Path.of("lib"), |
|
105 PathRole.DLLS, Path.of("lib"), |
|
106 PathRole.APP_MODS, Path.of("lib/app/mods") |
91 )); |
107 )); |
92 } |
108 } |
93 |
109 |
94 static ApplicationLayout windowsApp() { |
110 static ApplicationLayout windowsApp() { |
95 return new ApplicationLayout(Map.of( |
111 return new ApplicationLayout(Map.of( |
96 PathRole.LAUNCHERS_DIR, Path.of(""), |
112 PathRole.LAUNCHERS, Path.of(""), |
97 PathRole.APP, Path.of("app"), |
113 PathRole.APP, Path.of("app"), |
98 PathRole.RUNTIME, Path.of("runtime"), |
114 PathRole.RUNTIME, Path.of("runtime"), |
99 PathRole.DESKTOP, Path.of("") |
115 PathRole.DESKTOP, Path.of("") |
100 )); |
116 )); |
101 } |
117 } |