Explanation of the Code Base

From PCGen Wiki
Revision as of 14:06, 24 November 2008 by Karianna (talk | contribs) (Packages)
Jump to: navigation, search

High level overview of PCGen Code Base

src/java/pcgen is where the code tree begins. The directories match the package names — so pcgen.core would be src/java/pcgen/core (or src\java\pcgen\core if you are on Windows).

5.15.0 and beyond

As of 5.15.0 (Alpha), we've been incorporating elements of CDOM, please refer to the following documents:

http://www.geocities.com/thpr/Arch-5.16-0.60-0.0.pdf http://www.geocities.com/thpr/Arch-5.16-0.60-2.0.pdf

Packages

pcgen.base.*

New CDOM classes

pcgen.cdom.*

New CDOM classes

pcgen.rules.*

New CDOM classes

pcgen.core

This is where the business logic goes. This is the main engine that makes things work. The most important class in here is PObject, many classes are subclassed from this (like PCClass, Race, Feat, Spell, etc.). Another important class is PlayerCharacter which is where the player characters are constructed and manipulated. Globals contains the lists of objects loaded when a user loads their desired sources. Constants holds most of the code constants so you do not need to remember their values.

pcgen.gui

This is the GUI logic. The main method is in pcGenGUI, and the frame is in PCGen_Frame1. The editors are all defined in the editor package, and all the tab frames are in the tabs package.

pcgen.io

This is where the disk writing stuff occurs, like creating/parsing pcg files, and exporting character sheets.

pcgen.persistence

This is where the lst files are read in. The class that controls the loading is SystemLoader.

pcgen.util

This is where generally useful classes that are don't fit any of the other categories go.

plugin

This is where the pluggable features go. This includes tools such as Character Sheet, Dicebag, Random Name Generator, Encounter Generator, Network Management, Experience Tracker, Initiative Tracker, GM Notes, Overland Travel and the Character Tracker. It also includes processors for the variety of Lst Tokens and Output Tokens. There is also an Architectural Discussion of the PCGen Persistence Plugin System to help provide additional explanation of how the Lst Tokens work.

See the Javadocs for further details of the PCGen code base.