HoverRace
2.0
|
The collection of all registered rulebooks. More...
#include <RulebookLibrary.h>
Public Types | |
using | const_iterator = sorted_t::const_iterator |
using | value_type = sorted_t::value_type |
Public Member Functions | |
RulebookLibrary (Script::Core &scripting) | |
void | Add (std::shared_ptr< Rulebook > &rulebook) |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
const_iterator | end () const |
std::shared_ptr< const Rulebook > | Find (const std::string &name) |
Search for the Rulebook with the given name. More... | |
std::shared_ptr< const Rulebook > | GetDefault () const |
Retrieve the default rulebook. More... | |
void | Reload () |
Run all rulebook scripts to re-populate the rulebook library. More... | |
Private Types | |
using | sorted_t = std::set< std::shared_ptr< const Rulebook >, boost::less_pointees_t< std::shared_ptr< const Rulebook >>> |
Private Attributes | |
std::shared_ptr< Rulebook > | defaultRulebook |
std::map< std::string, std::shared_ptr< Rulebook > > | library |
Script::Core & | scripting |
sorted_t | sorted |
The collection of all registered rulebooks.
using HoverRace::Client::RulebookLibrary::const_iterator = sorted_t::const_iterator |
|
private |
using HoverRace::Client::RulebookLibrary::value_type = sorted_t::value_type |
HoverRace::Client::RulebookLibrary::RulebookLibrary | ( | Script::Core & | scripting | ) |
void HoverRace::Client::RulebookLibrary::Add | ( | std::shared_ptr< Rulebook > & | rulebook | ) |
|
inline |
|
inline |
|
inline |
|
inline |
std::shared_ptr< const Rulebook > HoverRace::Client::RulebookLibrary::Find | ( | const std::string & | name | ) |
std::shared_ptr< const Rulebook > HoverRace::Client::RulebookLibrary::GetDefault | ( | ) | const |
Retrieve the default rulebook.
This is normally the "Race" rulebook, but if it's not defined, then the first rulebook in sorted order is returned instead. If no rulebooks are loaded, then a dummy rulebook will be returned.
void HoverRace::Client::RulebookLibrary::Reload | ( | ) |
Run all rulebook scripts to re-populate the rulebook library.
|
private |
|
private |
|
private |
|
private |