Difference between revisions of "Explanation of the Code Base"

From PCGen Wiki
Jump to: navigation, search
(5.15.0 and beyond)
(pcgen.base.*)
Line 18: Line 18:
 
==pcgen.base.*==
 
==pcgen.base.*==
  
New CDOM classes
+
These classes are 'base' library elements.  None of these should be objects that are dependent upon pcgen.cdom or pcgen.core classes.  The intent is that pcgen.base elements are usable in any project, not specifically PCGen.  No item which is deeply tied to the concept of a Role-Playing Game or building a Player Character should be present in this package.
  
 
==pcgen.cdom.*==
 
==pcgen.cdom.*==

Revision as of 01:58, 3 April 2009

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:

Packages

pcgen.base.*

These classes are 'base' library elements. None of these should be objects that are dependent upon pcgen.cdom or pcgen.core classes. The intent is that pcgen.base elements are usable in any project, not specifically PCGen. No item which is deeply tied to the concept of a Role-Playing Game or building a Player Character should be present in this package.

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.