Peoplemon  0.1.0
Peoplemon 3 game source documentation
Classes | Public Member Functions | List of all members
core::system::Clock Class Reference

Simple time keeping systems. Tracks in game time and date based on real elapsed play time. More...

#include <Clock.hpp>

+ Inheritance diagram for core::system::Clock:

Classes

struct  Time
 Simple struct representing a point in time. More...
 

Public Member Functions

 Clock (Systems &owner)
 Initializes the clock system. More...
 
virtual ~Clock ()=default
 Destroys the system. More...
 
const Timenow () const
 Returns the current in game time. More...
 
void set (const Time &time)
 Sets the current time. More...
 
virtual void observe (const event::GameSaveInitializing &save) override
 Adds saved clock data to the save file. More...
 
virtual void observe (const event::GameSaveLoaded &load) override
 Initializes clock state from the loading game save. More...
 

Detailed Description

Simple time keeping systems. Tracks in game time and date based on real elapsed play time.

Definition at line 22 of file Clock.hpp.

Constructor & Destructor Documentation

◆ Clock()

core::system::Clock::Clock ( Systems owner)

Initializes the clock system.

Parameters
ownerThe owner of this system

Definition at line 12 of file Clock.cpp.

◆ ~Clock()

virtual core::system::Clock::~Clock ( )
virtualdefault

Destroys the system.

Member Function Documentation

◆ now()

const Clock::Time & core::system::Clock::now ( ) const

Returns the current in game time.

Returns
const Time& The current in game time

Definition at line 17 of file Clock.cpp.

◆ observe() [1/2]

void core::system::Clock::observe ( const event::GameSaveInitializing save)
overridevirtual

Adds saved clock data to the save file.

Definition at line 87 of file Clock.cpp.

◆ observe() [2/2]

void core::system::Clock::observe ( const event::GameSaveLoaded load)
overridevirtual

Initializes clock state from the loading game save.

Definition at line 91 of file Clock.cpp.

◆ set()

void core::system::Clock::set ( const Time time)

Sets the current time.

Parameters
timeThe new current time

Definition at line 29 of file Clock.cpp.


The documentation for this class was generated from the following files: