Well as far as i am concerned it is still the correct way…
for what you are describing i would use a state-dependent Strategy-Pattern…
here is a link to the Strategy Design Pattern of the Gang of Four
if you don’t know the book “Design Patterns: Elements of Reusable Object-Oriented Software” yet, i highly recommend you read it before you go too deep into design decisions… It’s like the bible of software architecture and computer games tend to have very complex architectures…
anyway i don’t think you can leave the StateMachine-approach behind…
I would design it with several global Player states like
- “is in Fighting mode”
- “is in Trading Mode”
- “is in Free Walking mode”
and depending of your global state i would implement different strategies for UserActionRequest:Main
and the UserActionRequests-Events would be invoked by your InputManager which maps the KeyboardEvents to UserActionRequest-Events…
Or do you want to know how to write a parser for your config file and how to map the keyboard events to your game events depending on the config file?