View Source ExRPG.RuleSystems (ExRPG v0.2.1)
Module which enables interactions with the varying defined systems in the system_configs. Basically sytem_configs define what systems are available and how they should be interpreted, and this module is is the beginning of the interpretation.
Link to this section Summary
Functions
Ensures a system is configured. If the system is configured, the system name is returned. If the system isn't configured, an exception is raised.
Checks if the given system is configured. Returns true if system is configured, otherwise false.
List the systems available
Reads in all of the JSON files for the specified and decodes the json into a %Systems{} struct
Returns the path to to the systems config directory
Link to this section Functions
Ensures a system is configured. If the system is configured, the system name is returned. If the system isn't configured, an exception is raised.
Checks if the given system is configured. Returns true if system is configured, otherwise false.
examples
Examples
iex> ExRPG.RuleSystems.is_configured?("dnd_5e_srd")
true
iex> ExRPG.RuleSystems.is_configured?("non_existent_system")
false
List the systems available
examples
Examples
iex> ExRPG.RuleSystems.list_systems()
["dnd_5e_srd"]
Reads in all of the JSON files for the specified and decodes the json into a %Systems{} struct
examples
Examples
iex> ExRPG.RuleSystems.load_system!("dnd_5e_srd")
%ExRPG.RuleSystems.RuleSystem{}
Returns the path to to the systems config directory
examples
Examples
iex> ExRPG.RuleSystems.system_path!("dnd_5e_srd")
"/full/path/to/project/ex_rpg/system_configs/dnd_5e_srd"