Closed bil-bas closed 14 years ago
I've pushed a commit to my fork that fixes this problem and also allows String
and Method
objects as actions. I'll see if ippa likes what I've done.
merged, tnx eris.
... hm, in a perfect world there would be some tests too heh :). Chingu lacks a lot of tests as it is now though.
Yessir. I'm not really sure how to write a decent automated test for something that requires user interaction. Hmmm.
@erisdiscord: Yeah, you thought about it even more than I did, but...erm, I was too lazy to fork. Thanks! You are quite right that the incorrect parameters should ideally raise an error when input is set, not when the input is being handled. Hadn't considered that :$
@ippa: Tests would be nice, though I can imagine they would be really messy in this sort of app.
The input system checks to see if a class given is directly inheriting from GameState, so if you have
where:
then StartGame won't get recognised as a GameState (Not a priority for me since you can just use a very simple #new to get around the issue; just something I noticed). InputDispatcher.rb line 96, anyway.
EDIT: Could also raise an exception if they pass the wrong value, rather than just ignoring it.