This commit is contained in:
lollipopkit
2023-08-09 23:58:38 +08:00
parent 58fbd62779
commit c512a6a274
36 changed files with 243 additions and 160 deletions

View File

@@ -12,11 +12,22 @@ class Server {
}
enum ServerState {
failed,
disconnected,
connecting,
connected,
failed;
bool get shouldConnect =>
this == ServerState.disconnected || this == ServerState.failed;
/// Connected to server
connected,
/// Status parsing
loading,
/// Status parsing finished
finished;
bool get shouldConnect => this < ServerState.connecting;
bool get canViewDetails => this == ServerState.finished;
operator <(ServerState other) => index < other.index;
}