diff --git a/RoleDeckComponents/Roledeck.cs b/RoleDeckComponents/Roledeck.cs index 482bfb5..91b2e51 100644 --- a/RoleDeckComponents/Roledeck.cs +++ b/RoleDeckComponents/Roledeck.cs @@ -81,13 +81,21 @@ private readonly void PopulateRolelist() { for (int i = 0; i < _rolelist.Length; i++) { - _rolelist[i] = new string[_roleDeck["roleList"]![i]!["options"]!.Count()]; - - for (int j = 0; j < _rolelist[i].Length; j++) + switch (_roleDeck["roleList"]![i]!["type"]!.ToString()) { - string type = _roleDeck["roleList"]![i]!["options"]![j]!["type"]!.ToString(); - _rolelist[i][j] = _roleDeck["roleList"]![i]!["options"]![j]![type]!.ToString(); - } + case "any": + _rolelist[i] = ["any"]; + break; + default: + _rolelist[i] = new string[_roleDeck["roleList"]![i]!["options"]!.Count()]; + + for (int j = 0; j < _rolelist[i].Length; j++) + { + string type = _roleDeck["roleList"]![i]!["options"]![j]!["type"]!.ToString(); + _rolelist[i][j] = _roleDeck["roleList"]![i]!["options"]![j]![type]!.ToString(); + } + break; + } } } private readonly void PopulatePhaseTimes()