View Source Document

object_model.markdown

Object Model Reference

CARPE DIEM v2000.11.10


Introduction

This document aims to be a brief but comprehensive overview and help guide to the object networks used in the CARPE DIEM roguelike game engine.

It is certainly incomplete and inaccurate in places, but is better than no documentation at all (knock on wood.) All information contained herein is subject to change, in terms of interface, naming, and implementation. Interfaces marked with (???) are extremely likely to change.

Object Framework

Members on objects are of two basic types: methods, which are Perl functions, and attributes, which are mutable data members.

Kinds of methods include: derivations which return a value only; mutations which change the state of the object (and which may or may not return a value); and constructors, which return a new object while not changing the state of the old object (if any.) Constructors which create a new object based on an old object are sometimes called factories.

Kinds of attributes include event handlers, which are like methods in that they are executable. Names of event handlers always begin with on_, and their data type is always a string (which is usually simply evaluated by Perl's built-in mechanism.)

Part I. Utility Classes

Dice

Distribution

Fuses

Part II. Multiple Superclasses

Constructors

These object classes do not have constructors.

Physical

Physical Classes

All of these classes are subclasses of Physical (among other things.) As such, they inherit the methods and attributes of Physical objects as described above.

Actor

Item

Terrain

Non-Physical Classes

Talent

Region

Encounter