Description
write a program
that simulates a multi-user computer game as it relates to players visiting various
rooms in a large castle.
Multiple players can be in the same room simultaneously (to perform the activities
of the game) and your program should keep track of mapping between players and rooms.
You may determine the number of rooms and players and may choose other data structures
as you deem proper to use for the implementation, as long as the requirements listed
here are met.
Feel free to add your own tricks for making it like a game:)
Your program should:
– Create players as well as constructor(s) that create(s) all necessary data structure.
– Have a hashcode method that calculates the hashcode for the player (mapping the player
to the room).
– You should come up with your clever hashcode function!
– Allow adding the player to a room
– Take into account a situation that would trigger calculating the hashcode, based on
some change (i.e. the player’s desire to visit another room)
– List the players currently in each room
– Have a method that takes the room information and returns the players in that room
– Allow deleting a player, when the player loses the game
– Have all other methods that are needed (and proper to be included in a class) to make
your implementation complete
– A GUI/tester that would allow playing this game and thereby testing all the methods.
– Your submission should also include a UML drawing of your classes as well as the
hierarchy of classes/interfaces used from Java API (only those that are relevant to
this project, i,e, not scanner or String).
Submit the zip file that contains all java files (ONLY java not class or old java files),
the UML image, and any input file, if your program requires one.
Email me a report about how you divided the work and how it worked out.
Teams:
Christian & Catherine
Grading:
Compile and run (20):
Hashcode (10):
Use of map/hash table (30):
UML (10):
GUI (20):
Name and comments (10):