WraitheDX / realms_shattered

This is a CLI (command line interface) text RPG programmed in C++.
11 stars 6 forks source link

Add ability to process multiple commands from a string #64

Closed WraitheDX closed 4 years ago

WraitheDX commented 4 years ago

Write now, the game treats user input as a single command. Input should be processed and broken into all available tags, and provide access to any words or numbers that were not recognized commands.

New UserInput function idea:

std::string UserInput::player_input_process( std::vector <CommandTag> &command_tags )

Function can return the leftover string, which means all commands processed from that string should be erased from it. If the game needs to check if the remainder of the string holds a number, that should be handled with another call:

const bool UserInput::player_input_is_number( int &player_number, std::string &player_input )

Should return true if player_input is a number, false if not.

WraitheDX commented 4 years ago

Tackling this issue now. Issue resolved.