The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Enumerations | Functions
ng::depcheck Namespace Reference

Enumerations

enum  component_type { ERA, SCENARIO, MODIFICATION }
 

Functions

 MAKE_ENUM (component_availability,(SP,"sp")(MP,"mp")(HYBRID,"hybrid")) class manager
 Note to all triers: It's not guaranteed that the specified component will be selected (if the user denies to perform dependency resolution, all changes will be reverted). More...
 

Enumeration Type Documentation

Enumerator
ERA 
SCENARIO 
MODIFICATION 

Definition at line 29 of file depcheck.hpp.

Function Documentation

ng::depcheck::MAKE_ENUM ( component_availability  ,
(SP,"sp")(MP,"mp")(HYBRID,"hybrid")   
)

Note to all triers: It's not guaranteed that the specified component will be selected (if the user denies to perform dependency resolution, all changes will be reverted).

Consequently, it's essential to check the selected values after calling any trier.

Note to ctor & insert_element: Please note that the ctor collects data for scenario elements from "multiplayer" nodes, while insert_element from "scenario" nodes.

Tries to set the selected era

Parameters
idthe id of the era
forcewhether to skip dependency check

Tries to set the selected scenario

Parameters
idthe id of the scenario
forcewhether to skip dependency check

Tries to set the enabled modifications

Parameters
idsthe ids of the modifications
forcewhether to skip dependency check

Tries to enable/disable a specific modification

Parameters
indexthe index of the modification
activateactivate or deactivate
forcewhether to skip dependency check

Tries to set the selected era

Parameters
indexthe index of the era
forcewhether to skip dependency check

Tries to set the selected scenario

Parameters
indexthe index of the scenario
forcewhether to skip dependency check

Returns the selected era

Returns
the id of the era

Returns the selected scenario

Returns
the id of the scenario

Returns the enabled modifications

Returns
the ids of the modifications

Tells whether a certain mod is activated.

Parameters
indexthe index of the mod
Returns
true if activated, false is not

Tells whether a certain mod is activated.

Parameters
idthe string id of the mod
Returns
true if activated, false is not

Returns the selected era

Returns
the index of the era

Returns the selected scenario

Returns
the index of the scenario

Adds a new element to the manager's database

Parameters
typethe type of the element
dataa config object containing the dependency info for the element
indexwhere to insert the element

represents a component (era, modification or scenario)

holds all required info about the components and their dependencies

the id of the currently selected era

the id of the currently selected scenario

the ids of the currently selected modifications

used by save_state() and revert() to backup/restore era_

used by save_state() and revert() to backup/restore scenario_

used by save_state() and revert() to backup/restore mods_

saves the current values of era_, scenarios_ and mods_

restores the lastly saved values of era_, scenarios_ and mods_

Attempts to change the selected scenario.

Parameters
idthe scenario's id
Returns
true if the selection was changed; false if not

Attempts to change the selected era.

Parameters
idthe era's id
Returns
true if the selection was changed; false if not

Attempts to change the selected modifications.

Parameters
modificationsthe list of the modifications' ids
Returns
true if the selection was changed; false if not

Decides if two components are conflicting or not

Parameters
elem1the first component
elem2the second component
directonlywhether the function should ignore any possible conflicts between the components' dependencies.
Returns
true if e1 and e2 conflict, false if not

Decides whether e1 requires e2

Parameters
elem1a component; by definition, passing a modification here makes no sense
elem2another component; by definition, passing anything else than a modification here makes no sense
Returns
true if e2 is required by e1, false if not

Get the list of modifications required by a certain component

Parameters
ethe component
Returns
the list of the modifications' ids

Get the list of modifications which are required by a certain component, but aren't currently enabled

Parameters
ethe component
Returns
the list of the modifications' ids

Get the list of modifications which are conflicting a certain component and are currently enabled

Parameters
ethe component
Returns
the list of the modifications' ids

Get the list of modifications which are required by a certain component, but currently unavailable on the computer

Parameters
ethe component
Returns
the list of the modifications' ids

Display a dialog requesting confirmation for enabling some modifications

Parameters
modsthe list of modifications to be enabled
requesterthe add-on's name which requests the action to be done
Returns
true, if the user accepted the change, false if not

Display a dialog requesting confirmation for disabling some modifications

Parameters
modsthe list of modifications to be disabled
requesterthe add-on's name which requests the action to be done
Returns
true, if the user accepted the change, false if not

Display a dialog requesting the user to select a new era

Parameters
erasthe possible options (ids)
Returns
the selected era's id or empty string if the user refused to select any

Display a dialog requesting the user to select a new scenario

Parameters
scenariosthe possible options (ids)
Returns
the selected scenario's id or empty string if the user refused to select any

Shows an error message

Parameters
msgthe message to be displayed

Decides whether a certain component is installed or not

Parameters
ethe component
Returns
true if the component exists false if not

Look up the name of a given component.

Parameters
ethe component
Returns
the name of the component

Definition at line 36 of file depcheck.hpp.

References _(), e, image::exists(), utf8::index(), preferences::modifications(), wfl::msg(), operator!=(), and operator==().