cpd_David_und_Yusuf/lib/models/role.dart

22 lines
793 B
Dart
Raw Normal View History

2024-06-18 01:46:57 +02:00
// Enum representing different roles in the game
enum Role { dorfbewohner, werwolf, joker, seher, doctor }
2024-06-18 01:46:57 +02:00
// Extension on the Role enum to provide string representations
extension RoleExtension on Role {
2024-06-18 01:46:57 +02:00
// Getter to convert enum value to its string representation
String get stringValue {
switch (this) {
case Role.dorfbewohner:
2024-06-18 01:46:57 +02:00
return 'Dorfbewohner'; // Returns 'Dorfbewohner' for the dorfbewohner role
case Role.werwolf:
2024-06-18 01:46:57 +02:00
return 'Werwolf'; // Returns 'Werwolf' for the werwolf role
case Role.joker:
2024-06-18 01:46:57 +02:00
return 'Joker'; // Returns 'Joker' for the joker role
case Role.seher:
2024-06-18 01:46:57 +02:00
return 'Seher'; // Returns 'Seher' for the seher role
case Role.doctor:
2024-06-18 01:46:57 +02:00
return 'Doctor'; // Returns 'Doctor' for the doctor role
}
}
}