Question: Computer Science Java question Weve been asked to help build a new medieval adventure game, Summer Is Coming. Were trying to figure out the gameplay

Computer Science Java question

Weve been asked to help build a new medieval adventure game, Summer Is Coming. Were trying to figure out the gameplay mechanics, so were starting with representations for travel around the game world. Players can live in three types of housing: a Hut, an Inn, and a Castle.

A Hut has a capacity and the current count of its population. The population must be less than the capacity.

An Inn has a name, capacity and the current count of its population as well as the number of stalls in its stable. The population must be less than the capacity.

A Castle has a name, the family-name of the owners, the current count of its population as well as the number of carriages it can hold in its carriage-house.

There are 2 types of transportation in this game:

  • Horse

  • Carriage

Each type of transportation should have a from and a to housing. Horses also have a name and a color (which you may represent using the colors name). They can only go to an inn if there is room in the stables, but they can go to any hut or castle.

Carriages can only carry a limited supply of tonnage and only travel from Inns to Castles or vice versa. When they go to a Castle there must be room for them in the carriage house.

  • Define six examples of housing, including:

    • hovel: Capacity 5, population 1

    • winterfell: Named "Winterfell", family name "Stark", population 500, can hold 6 carriages

    • crossroads: Named "Inn At The Crossroads", capacity 40, population 20, 12 stalls

    The others can be whatever you wish.

  • Define four types of travel, two of each kind.

Name your examples horse1, carriage2, etc., and your examples class ExamplesTravel.

Please note: Were placing a lot of restrictions on the data, such as the population being less than capacity, possible destinations of carriages, etc. However we arent (yet) actually enforcing these in the code. The ways to enforce these constraints will be further explored later in the semester. For now, you are expected to create examples that conform to these constraints

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!