Skip to content

Commit

Permalink
Items - accept format string in Look
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbymcr committed Dec 13, 2018
1 parent d74cbb9 commit 040acd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/Items.cs
Expand Up @@ -42,11 +42,11 @@ public void Deactivate()
this.sub = null;
}

public void Look()
public void Look(string itemFormat)
{
foreach (string item in this.items.Values.Select(i => i.ShortDescription))
{
this.Output($"There is {item} here.");
this.Output(string.Format(itemFormat, item));
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/Room.cs
Expand Up @@ -126,7 +126,7 @@ private void UnknownVerb(Word verb, Word noun)
private void LookAround()
{
this.Output(this.Description);
this.items.Look();
this.items.Look("There is {0} here.");
}

private bool LookAt(Word noun)
Expand Down

0 comments on commit 040acd4

Please sign in to comment.