View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Fall 2004 M1

Create Objects to Represent Characters and Things

The primary focus of a simulation game is the characters that inhabit the simulated world. You will begin this project by defining a class to represent various characters that will play roles in the world of SimTech. Because you also will be concerned with posessions and other inanimate factors in the game, you will also have to represent them with a different class, since they don't have the same set of behaviors as a character does. Finally, it will likely be convenient to save a game in some way other than by just saving a Squeak image. You will have to create an external representation for the objects used to define you SimTech world.


Because the name Character is already used as a class name in Squeak, we have to pick another name for the class that will represent the people of SimTech. To keep things simple, we will just can the class Person.

1. You will create an object to represent an individual by sending new to Person. You must implement the following methods to associate information with a person (assume that p := Person new. q := Person new. r := Person new.) :

2. You will create an object to represent a generalized "thing" by sending new to Thing. You must implement the following methods to associate information with a thing (assume that t := Thing new.) :
There will be a number of subclasses of Thing as we add more details to the game.

3. You are to create tha ability to export the state of your "game" by creating a textual representation of all of the Person and Thing objects defined in your game world. You will later have to read in your textual representation to initialize a game state, so think about this step as you define your textual representation.

4. Test the classes you implement using SUnit. You should have SUnit classes PersonTest and ThingTest that test Person and Thing. These should be runnable from within TestRunner and contain tests for each method.


Before class time on the due date, turn-in your well-documented code (at least two lines of comments for each non-accessor method, in-line comments at significant portions) using the turnin coweb:


Links to this Page