You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.
You can see this happen with PURGE: there are two implementations of invoke() and it's supposed to try binding your arguments to each implementation, find the best match and run that.
What actually happens is it tries to run both and displays both an error message and the successful output from the command. Less than ideal.
Another more subtle issue here is that there's no way to tell PURGE that (for example) you'd prefer it try to bind to items in your inventory before items on the floor. What if there were items that match your argument in both places? Which one is it going to choose first? The answer right now is that it's completely arbitrary and up to Java reflection to decide!
So there are two acceptance criteria for this issue:
Invoking a command should never produce two distinct sets of output (e.g. an error message and a success message glued together). Only show an error message to the user if none of the invoke() implementations could successfully bind.
There needs to be a way for the programmer to specify which order the implementations are tried. Some commands will have variations based on whether a target is worn, in your inventory, on the ground, or possibly somewhere else in the game. You will almost always want the command to do the smallest-scoped search first and progress to the largest scope last - both for efficiency and because that's what would generally make the most sense to the player.
The text was updated successfully, but these errors were encountered:
You can see this happen with PURGE: there are two implementations of
invoke()
and it's supposed to try binding your arguments to each implementation, find the best match and run that.What actually happens is it tries to run both and displays both an error message and the successful output from the command. Less than ideal.
Another more subtle issue here is that there's no way to tell PURGE that (for example) you'd prefer it try to bind to items in your inventory before items on the floor. What if there were items that match your argument in both places? Which one is it going to choose first? The answer right now is that it's completely arbitrary and up to Java reflection to decide!
So there are two acceptance criteria for this issue:
invoke()
implementations could successfully bind.The text was updated successfully, but these errors were encountered: