opt.: server provider

This commit is contained in:
lollipopkit
2023-11-02 13:41:28 +08:00
parent 9000228698
commit 220f4c6723
4 changed files with 56 additions and 56 deletions

View File

@@ -22,6 +22,12 @@ class Server implements TagPickable {
@override
String get tagName => spi.id;
bool get needGenClient => state < ServerState.connecting;
bool get canViewDetails => state == ServerState.finished;
String get id => spi.id;
}
enum ServerState {
@@ -38,9 +44,5 @@ enum ServerState {
/// Status parsing finished
finished;
bool get shouldConnect => this < ServerState.connecting;
bool get canViewDetails => this == ServerState.finished;
operator <(ServerState other) => index < other.index;
}