Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named handlers for SDLx::Controller #133

Open
kthakore opened this issue Jul 24, 2011 · 0 comments
Open

Named handlers for SDLx::Controller #133

kthakore opened this issue Jul 24, 2011 · 0 comments
Assignees

Comments

@kthakore
Copy link
Member

What about get names for all handlers? For example:

$app->add_move_handler(player => sub{...});
$app->add_move_handler(unit1 => sub{...});
$app->add_move_handler(unit2 => sub{...});

...

$app->remove_move_handler('unit1');

It`s get more flexible behavior. Not need store indexes and use them, just use name what you set and you known.

To do:

  • Replace handlers array to hash
  • For save current behavior: set number as key for handler if key not specified

What do you think about that?

@ghost ghost assigned rshadow Jul 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants