CromulentEntity / Dungeon_Crawler_Deux

Text based Dungeon Crawler game, built in Java from scratch.
0 stars 0 forks source link

Console Helper Range Validation? #3

Closed CromulentEntity closed 2 years ago

CromulentEntity commented 2 years ago

Add range validation to ConsoleHelper to ensure input is within a numeric range. I forget why but needed to note this for the future.

CromulentEntity commented 2 years ago

So I think this was to validate that numeric inputs were found on the list of possible options when choosing an action. Because these inputs are handled as Strings and not integers, and because a switch statement checks these strings against the valid inputs, validating ranges in this way is not needed. Any non-valid inputs are dealt with in the default section of the switch.

CromulentEntity commented 2 years ago

Loosely related validation was added in https://github.com/CromulentEntity/Dungeon_Crawler_Deux/commit/656f0f9af00a4ff83b501fd518df1a19317af522.