# PCC2ng: Big List Of Objects

## Legend

Obj | Has notifyListeners() method and/or sig_change signal
Obj | Has markChanged() method
Obj | Pointed-to by shared smart pointer (and thus shareable)
Obj | Reference to another object
Obj | Optional (may not exist, pointer can be null)
Obj | Derived instance of class with virtual methods
Obj | Planned but not implemented
[] | Container has multiple objects of this type

This document lists the (planned and existing) object structure of PCC2ng in an abstract, high-level format.

- Game
- Browser
- User Interface
- File Server
- Host Server

## Game

The game::Session is the root of anything that is done with game data. All accesses to game::Session happen in a single thread. This is either the only thread (console programs), or a background thread (GUI programs). The game::Session also includes the interpreter::World.

game::Session
Root : game::Root
GameDir : afl::io::Directory Local game directory
SpecLoader : game::SpecificationLoader Virtual object to load a ShipList
Actions : game::Root::Actions_t Permitted actions on this game
HostVersion : game::HostVersion
RegKey : game::RegistrationKey
HostConfig : game::config::HostConfiguration
UserConfig : game::config::UserConfiguration Includes directory configuration such as charset, editability
PlayerList : game::PlayerList Players including race names, nicks, etc.
Player : game::Player[]
TurnLoader : game::TurnLoader Virtual object to load a game turn
StringVerifier : game::StringVerifier Virtual object to define rules for string properties (e.g. permitted characters in friendly codes)
Charset : afl::charset::Charset Virtual object to describe the character set of files in GameDir
ShipList : game::spec::ShipList
Beams : game::spec::ComponentVector
Beam : game::spec::Beam[]
Engines : game::spec::ComponentVector
Engine : game::spec::Engine[]
Launchers : game::spec::ComponentVector
Launcher : game::spec::TorpedoLauncher[]
Hulls : game::spec::ComponentVector
Hull : game::spec::Hull[]
BasicHullFunctions : game::spec::BasicHullFunctionList Definition of basic functions such as "Cloak" (hullfunc.cc)
Functions : game::spec::BasicHullFunction[]
DefaultAssignment : (int,int)[]
ModifiedHullFunctions : game::spec::ModifiedHullFunctionList Definition of modified hull functions such as "Cloak at experience level 3"
ModifiedFunction : game::spec::HullFunction[]
RacialAbilities : game::spec::HullFunctionAssignmentList
HullAssignments : game::spec::HullAssignmentList
ComponentNamer : game::spec::ComponentNameProvider
FriendlyCodes : game::spec::FriendlyCodeList
FriendlyCode : game::spec::FriendlyCode[]
Missions : game::spec::MissionList
Mission : game::spec::Mission[]
Game : game::Game
PlanetScoreDef, ShipScoreDef : game::UnitScoreDefinitionList
TurnScores : game::TurnScoreList
Selections : game::map::Selections
Teams : game::TeamSettings
Viewpoint : int
Cursors : game::map::Cursors
CurrentShip/Planet/Base, etc... : game::map::SimpleObjectCursor
Location: game::map::Location
HistoryTurnList : game::HistoryTurnList
MessageConfiguration : game::msg::Configuration Message filters
ExpressionLists : game::config::ExpressionLists LRU and predefined expressions
Config : game::map::Configuration
CurrentTurn : game::Turn
Inbox : game::msg::Inbox
Outbox : game::msg::Outbox
Battles : game::vcr::Database
Battle : game::vcr::Battle[]
Unit : game::vcr::Object[]
Allies
Extra : game::ExtraContainer
Commands : game::v3::CommandContainer
Command : game::v3::Command[]
Gen
DataSet
TurnNumber : int
TimeStamp : game::Timestamp
DatabaseTurn : int
Universe : game::map::Universe
Ships : game::map::ObjectVector
Ship : game::map::Ship[]
Planets : game::map::ObjectVector
Planet : game::map::Planet[]
Storms : game::map::ObjectVector
Storm : game::map::IonStorm[]
Minefields : game::map::ObjectVector
Minefield : game::map::Minefield[]
Ufos : game::map::ObjectVector
Ufo : game::map::Ufo[]
Explosions : game::map::ObjectVector
Explosion : game::map::Explosion[]
Drawings : game::map::DrawingContainer
Drawing : game::map::Drawing[]
Reverter : game::map::Reverter
Extra
ScriptSide : client::si::ScriptSide Communication to UserSide for scripts
SimState : game::sim::Session
Setup : game::sim::Setup
Ship : game::sim::Ship[]
Planet : game::sim::Planet
Config : game::sim::Configuration
Log : afl::sys::Log
RandomNumberGenerator : util::RandomNumberGenerator
InterpreterInterface : game::InterpreterInterface
UserInterfacePropertyAccessor : game::interface::UserInterfacePropertyAccessor[]
EditableAreas : AreaSet_t Read-only/read-write status for database and turn data
World : interpreterinterface::World Interpreter core with little VGAP interdependencies
GlobalPropertyNames, ShipPropertyNames, PlanetPropertyNames : afl::data::NameMap
GlobalPropertyValues : afl::data::Segment
ShipPropertyValues, PlanetPropertyValues : interpreter::ObjectPropertyVector
Specials : interpreter::SpecialCommand[]
Keymaps : util::KeymapTable
Keymap : util::Keymap[]
Atoms : util::AtomTable
GlobalContexts : interpreter::Context[]
LogListener : afl::sys::LogListener
Translator : afl::string::Translator
MutexList : interpreter::MutexList
FileTable : interpreter::FileTable
FileCharset : afl::charset::Charset Kept in sync with Root.Charset by Session
SystemLoadDir, LocalLoadDir : afl::io::Directory
FileSystem : afl::io::FileSystem
ProcessList : interpreter::ProcessList
Process : interpreter::Process[]
Plugins : util::plugin::Manager
Plugin : util::plugin::Plugin[]
AuthCache : game::AuthCache
Notifications : game::interface::NotificationStore

## Browser

The role of a browser is to obtain a game::Root that can be used to bootstrap a game::Session. It is separate from game::Session to allow programs that use only one of them. All accesses to game::browser::Session happen in a single thread, which is the same one as the thread that accesses the game::Session.

The browser will eventually provide a game::Root. The game::Root will contain a SpecificationLoader and a TurnLoader, presence of which determines what you can do with the game. It will also contain a set of actions that can be applied to the directory associated with it.

game::browser::Session
Translator : afl::string::Translator
Log : afl::sys::LogListener
AccountManager : game::browser::AccountManager
Account : game::browser::Account[]
UserCallback : game::browser::UserCallback
Favorites
Browser : game::browser::Browser
HandlerList : game::browser::HandlerList
Handler : game::browser::Handler[]
Path : game::browser::Folder[]
Content : game::browser::Folder[]
Origin : game::browser::Folder
ChildRoot : game::Root
Tasks game::browser::Task_t[]

## User Interface

A GUI program can be built starting with a ui::Root. A GUI program that operates on VGAP data uses a UserSide / ScriptSide pair to talk to the VGAP data. (There used to be a `client::Session`, which essentially wrapped just a UserSide.)

UserSide : client::si::UserSide
Root : ui::Root
Engine : gfx::Engine
Dispatcher : util::RequestDispatcher
Timer
Canvas : gfx::Canvas
ResourceProvider : gfx::ResourceProvider (ui::DefaultResourceProvider)
Manager : ui::res::Manager
ImageLoader : ui::res::ImageLoader[]
ResourceProvider : ui::res::Provider[]
ScreenSize : gfx::Point
ImageCache : gfx::Canvas[]
FontList : gfx::Font[]
ColorScheme : ui::ColorScheme
EventQueue : afl::base::Runnable[]
Window : ui::Widget...
ChildWidget : ui::Widget[]...
GameSender : util::RequestSender
Session : game::Session
ScriptSideSender : util::RequestSender
Translator : afl::string::Translator
Console : util::MessageCollector
Log : afl::sys::Log
Control : client::si::Control[]

## File Server

Structure of the file server root. Each command is processed using a shared root and a per-session state.

server::file::Root
RootDirectory : server::file::DirectoryItem Root directory (provides access to children)
Handler : server::file::DirectoryHandler Defines how data is actually stored (direct, internal, CA, ...)
DefaultSpecDirectory : afl::io::Directory Default specification directory
DefaultCharset : afl::charset::CodepageCharset
DefaultRaceNames : server::file::RaceNames_t
Scanner : game::v3::DirectoryScanner

## Host Server

Structure of the host server root. Each command is processed using a shared root and a per-session state.

server::host::Root
Database : afl::net::CommandHandler
HostFile : afl::net::CommandHandler
UserFile : afl::net::CommandHandler
MailQueue : server::interface::MailQueue
CheckturnRunner : util::ProcessRunner
FileSystem : afl::io::FileSystem
Cron : server::host::Cron
TalkListener : server::host::TalkListener
Router : server::interface::SessionRouter
Arbiter : server::host::GameArbiter
RNG : util::RandomNumberGenerator