So far i have a huge hardcoded ifelse block, that does not seem good or scalable.
What is the best practice in processing player input?
EDIT: The problem is how to organize and process user input efficiently.
I suppose using huge if/ifelse/else branches is not the best way.
With single word non session commands it is easy. But when it comes to multi word commands, like "help skills", "use bag", "take sword from bag" the if/elseif/else pattern is soo cumbersome and not scalable.
Also, what regards commands in one session, like so:
open box
look inside box
//you see next items inside box: one, two, three
take one
How to process different options depth, when each command received from client is processed from beginning? How to respond with "first you must open box to take items from it" if user enters "take one" without prior "open box"?