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

Command Aliases starting new game #3

Open
allen-liaoo opened this issue May 6, 2017 · 1 comment
Open

Command Aliases starting new game #3

allen-liaoo opened this issue May 6, 2017 · 1 comment
Assignees
Labels

Comments

@allen-liaoo
Copy link
Owner

Occurs in games that uses classes in Game folder.
Using two different aliases to call the command will make two command class because of the HashMap.
For example, calling =hangman start, then =hm end will say the game haven't started yet, because they creates two different command classes.

@allen-liaoo
Copy link
Owner Author

Possible solution: creates another HashMap (per guild) specifically for commands that requires this use. And creates all objects and fill them in the HashMap.
For example,

commands.put("hangman", new HangManCommand());      
commands.put("hm", new HangManCommand());

Should be

HangManCommand hm = new HangManCommand();
guildObj.put("hangman", hm);        
guildObj.put("hm", hm);

@allen-liaoo allen-liaoo added the bug label May 6, 2017
@allen-liaoo allen-liaoo self-assigned this May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant