Create a player class and a Key class. A Player hasa name, HP, and a key. A character may only have one key at a time, a Key contains a String array that lists the names of all the placed the key can go. The key should have a use() function that takes in a string of what it is trying to be used on, the function will return true if it can be used on that door, and false if it cannot. The player can pick Up and Drop a key.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 2CP
icon
Related questions
Question

Create a player class and a Key class. A Player hasa name, HP, and a key. A character may only have one key at a time, a Key contains a String array that lists the names of all the placed the key can go. The key should have a use() function that takes in a string of what it is trying to be used on, the function will return true if it can be used on that door, and false if it cannot. The player can pick Up and Drop a key.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,