Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Static Public Member Functions | List of all members
SWRS::RulesSystem Class Reference

Main class (serving also as a factory class for characters) of a savage worlds rules system implementation. More...

#include <sw.hpp>

Collaboration diagram for SWRS::RulesSystem:
Collaboration graph

Public Types

enum  { SW, Verbal, Pips }
 when traits are represented in stringified format More...
 

Public Member Functions

void Initialize (const std::string &path)
 initialize with given path to config file
 
Character SpawnCharacter () const
 Generate new character with blank character sheet.
 
Character LoadCharacterFromFile (const std::string &path) const
 Load from file.
 
Character LoadCharacterFromFileAt (int fd, const std::string &path) const
 Load character from file using openat (2)
 
Character LoadCharacterFromMemory (const char *data) const
 Load character from memory string (must be null terminated)
 
const char * SerializeCharacter (const Character &) const
 
int SaveCharacter (const Character &, const std::string &path) const
 store character in file (0 returned upon success)
 
int SaveCharacterAt (const Character &, int fd, const std::string &path) const
 store character in file using openat (0 returned upon success)
 
const TraitMapGetTraitMap () const
 return map of traits loaded from config (and available to characters)
 
const HindranceMapGetHindranceMap () const
 return map of hindrances loaded from config (and available to characters)
 
const EdgeMapGetEdgeMap () const
 return map of edges loaded from config (and available to characters)
 
const PowerMapGetPowerMap () const
 return map of powers loaded from config (and available to characters)
 

Static Public Member Functions

static void SetTraitRepresentation (int f)
 SW, Verbal, Pips.
 
static int GetTraitRepresentation ()
 SW, Verbal, Pips.
 

Detailed Description

Main class (serving also as a factory class for characters) of a savage worlds rules system implementation.

Member Enumeration Documentation

anonymous enum

when traits are represented in stringified format

Enumerator
SW 

"d4" "d6" "d8"

Verbal 

"strong" "weak"

Pips 

"**" "****"

Member Function Documentation

const char * RulesSystem::SerializeCharacter ( const Character character) const

Serialize character; returned character is null terminated string that is malloc(3) allocated and needs to be freed after using


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