Conquer Space 0.0.0
A space themed grand strategy game set in the near future, with realistic orbital mechanics, and an emphasis on economics and politics.
Public Member Functions | Private Attributes | List of all members
cqsp::common::systems::SysScript Class Reference

Runs scripts that are added to the game More...

#include <scriptrunner.h>

Inheritance diagram for cqsp::common::systems::SysScript:
cqsp::common::systems::ISimulationSystem

Public Member Functions

 SysScript (Game &game)
 
 ~SysScript ()
 
void DoSystem ()
 
int Interval ()
 
- Public Member Functions inherited from cqsp::common::systems::ISimulationSystem
 ISimulationSystem (Game &game)
 
virtual ~ISimulationSystem ()=default
 

Private Attributes

std::vector< sol::table > events
 

Additional Inherited Members

- Protected Member Functions inherited from cqsp::common::systems::ISimulationSystem
GameGetGame ()
 
UniverseGetUniverse ()
 

Detailed Description

Runs scripts that are added to the game

To run a script every single tick, you have to do this:

local test_event = {
-- you can define all sorts of variables needed here
}
local test_event:on_tick()
-- All sorts of events take place here
end
-- then add it to the event queue.
events:insert(test_event)

This is likely to be unoptimized because it runs all the scripts every single tick.

Constructor & Destructor Documentation

◆ SysScript()

cqsp::common::systems::SysScript::SysScript ( Game game)
explicit

◆ ~SysScript()

cqsp::common::systems::SysScript::~SysScript ( )

Member Function Documentation

◆ DoSystem()

void cqsp::common::systems::SysScript::DoSystem ( )
virtual

◆ Interval()

int cqsp::common::systems::SysScript::Interval ( )
inlinevirtual

How often is DoSystem is run. It will be run every n number of ticks when the tick becomes a multiple of the number below. The default is 24

Reimplemented from cqsp::common::systems::ISimulationSystem.

Member Data Documentation

◆ events

std::vector<sol::table> cqsp::common::systems::SysScript::events
private

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