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

Ambiguous Moo objects should have a list of the objects that it matched. #2

Closed
christhekeele opened this issue Feb 6, 2013 · 0 comments
Assignees

Comments

@christhekeele
Copy link
Contributor

For instance, [MooObject ambiguous_match].list would yield `[ [MooObject wooden sword], [Moo Object iron sword] ]

Continuing the example from issue #1:

Example:

# usage: look at sword
#=> Look at which sword: wooden sword, iron sword?
# usage: look at wooden sword
#=> This sword clearly isn't as strong as, say, an iron one.

# function definition
String.prototype.capitalize = ->
  this.charAt(0).toUpperCase() + this.slice(1)
if $prepstr
  switch $iobj
    when $nothing
      $player.tell "Look " + $prepstr + " what?"
    when $ambiguity
      $player.tell "Look " + $prepstr + " which " + $iobjstr + ": " + (obj.name for obj in $ambiguity.list).join(", ") + "?"
    when $notFound
      $player.tell $iobjstr.capitalize + " doesn't seem to exist in this room."
    else
      $player.tell $iobjstr.description
else
  $player.tell $here.description + " Contents: " + (content.name for content in $here.contents).join(", ")
@ghost ghost assigned doughsay Feb 6, 2013
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