Gack Classes

In the Python version of The Land of Gack, there is no explicit NamedObject class. However, the classes Person, Place, and Thing are all still kinds of named objects, in that they all have the name attribute.

The classes fall into this inheritence hierarchy:

The following sections describe the attributes and methods of each class. Keep in mind that when a method is called, the self argument is normally not explicit. For example, consider the Person class's say method, which is documented as having the form say(self, text). This is the form you will find where the method is defined. But in the ordinary case where you want some person, p, to say something, you would use p.say(text). Only if you want to ignore what particular kind of person p is (such as that he is a Wizard) and have him say the text the normal-person way, you would use Person.say(p, text).

Person

Each instance of the Person class or any of its subclasses has the following attributes:

The Person class also defines the following methods:

AutoPerson

Beyond the inherited attributes, each instance of AutoPerson or any of its subclasses has the following attributes:

Also, the AutoPerson class itself has a class attribute, AutoPerson.registry, which is the instance of the Registry class that holds all the AutoPerson instances that have not been removed from action.

The AutoPerson class also defines the following methods, beyond those that are inherited:

Witch

Beyond the inherited attributes, each instance of the Witch class has the following attribute:

The Witch class defines the following methods, beyond those that are inherited:

Additionally, the Witch class provides an overriding definition for the act method.

Wizard

Beyond the inherited attributes, each instance of the Wizard class has the following attribute:

Instances of the Wizard class have only the inherited method names; however, this class provides an overriding definition for the act method.

Place

Each instance of the Place class has the following attributes:

The Person class also defines the following methods:

Thing

Each instance of the Thing class or any subclass has the following attributes:

The Thing class does not define any methods.

Scroll

The Scroll class does not add any atributes beyond those that are inherited. It adds one method:

Registry

Each instance of the Registry class has the following attribute:

The Registry class also defines the following methods: