Hi There!

I'm Dan Schlegel, an Assistant Professor in the Computer Science Department at SUNY Oswego

Assignment 5

In this assignment we complete the implementation of our game. Your functionality should already be complete, other than issues surrounding the timer which we have not yet implemented.

In order to have your timer run constantly in the background, it must be run from another thread. To do this safely, we will make use of an AtomicInteger to keep track of how much time is left in the game. A Java Timer object will schedule a task to decrement the the left every second. Most of the code required to initialize the timer is provided below – you should add it somewhere in your project which makes sense. You may decide to change these items to static if it makes your code cleaner.

The timer should be initialized when play begins (after the XML data file is loaded). The project specification allows for time to be added to timeLeft when certain conditions occur. You should add methods for increasing the time by an amount, and perhaps getting the time left. Check the AtomicInteger API for how to get and set values. After every action the user takes, you should print the amount of time left.

After adding the timer your code should be functionally complete – remember to check that all conditions in the project description are met.

You will also complete the implementation of the singly linked list begun in class by implementing the following methods:

You may not use the Iterator in implementing these methods (that’s for external use only). Create a driver class to test your linked list thoroughly. Then, replace the array which contains the Characters in your Room with your linked list. Be careful to remove (or comment out) all code that is now irrelevant.

There is extra credit available in this assignment – 10% extra credit will be added for implementing the optional remove() method in the iterator, using appropriate techniques (e.g., don’t just call the linked list’s remove).