Skip to content

Commit

Permalink
Added catch for any type
Browse files Browse the repository at this point in the history
  • Loading branch information
TB516 committed Apr 5, 2024
1 parent 6bd037e commit 74d067e
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions RoleDeckComponents/Roledeck.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 74d067e

Please sign in to comment.