-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: restructure Platform
#714
Conversation
//TODO(skaldarnar): I'm not fully settled on how to model the Platform. I thought splitting this up into two enums | ||
// for OS and Architecture would help with more type-safe construction of these values, simplify comparison to | ||
// select the right JRE for a game, etc. | ||
// | ||
// On the other hand, the set of supported platforms is so limited, and continuing on a non-supported platform | ||
// does not make much sense. So, maybe it is better to have a rather restrictive and explicit enum in the form of | ||
// WINDOWS_X64 | ||
// LINUX_X64 | ||
// I'm adding the architecture to this list, as I hope that we'll be able to support old Intel and new M1 Macs at | ||
// some point in the future, adding the following to the list: | ||
// MAC_X64 | ||
// MAC_AARCH64 | ||
// The biggest drawback of being super-strict here is that development on non-supported platforms becomes | ||
// impossible where it was just "not ideal" before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It think this should be as type-safe as possible. It shouldn't be possible to run the launcher on unsupported platforms unintentionally. Having seperate enums for OS
and Architecture
allows for greater flexibility in adding new platforms in the future and also makes it easier to significantly differentiate by OS alone where needed. You could also possibly make Platform
itself an enum for further type safety.
11bb4a3
to
76ee046
Compare
Contains
Restructure the
Platform
utility class and splits outOS
andArch
as separate enums.Loosely based on #708.
How to test
Nothing should change based on this PR.
Outstanding before merging
The feedback received sounded like we can can move forward with with this mostly as is. I've incorporated the idea of making
Platform
and enum itself.