![]() |
naev 0.11.5
|
Handles the application and removal of 'diffs' to the universe. More...
#include "unidiff.h"#include "conf.h"#include "array.h"#include "economy.h"#include "log.h"#include "map_overlay.h"#include "ndata.h"#include "nstring.h"#include "nxml.h"#include "safelanes.h"#include "space.h"#include "player.h"Go to the source code of this file.
Data Structures | |
| struct | UniDiffData_t |
| Universe diff filepath list. More... | |
| struct | UniHunkTarget_t |
| Represents the hunk's target. More... | |
| struct | UniHunk_t |
| Represents a single hunk in the diff. More... | |
| struct | UniDiff_t |
| Represents each Universe Diff. More... | |
Enumerations | |
| enum | UniHunkTargetType_t { HUNK_TARGET_NONE , HUNK_TARGET_SYSTEM , HUNK_TARGET_SPOB , HUNK_TARGET_TECH , HUNK_TARGET_FACTION } |
| Represents the possible hunk targets. More... | |
| enum | UniHunkType_t { HUNK_TYPE_NONE , HUNK_TYPE_SPOB_ADD , HUNK_TYPE_SPOB_REMOVE , HUNK_TYPE_VSPOB_ADD , HUNK_TYPE_VSPOB_REMOVE , HUNK_TYPE_JUMP_ADD , HUNK_TYPE_JUMP_REMOVE , HUNK_TYPE_SSYS_BACKGROUND , HUNK_TYPE_SSYS_BACKGROUND_REVERT , HUNK_TYPE_SSYS_FEATURES , HUNK_TYPE_SSYS_FEATURES_REVERT , HUNK_TYPE_TECH_ADD , HUNK_TYPE_TECH_REMOVE , HUNK_TYPE_SPOB_FACTION , HUNK_TYPE_SPOB_FACTION_REMOVE , HUNK_TYPE_SPOB_POPULATION , HUNK_TYPE_SPOB_POPULATION_REMOVE , HUNK_TYPE_SPOB_DISPLAYNAME , HUNK_TYPE_SPOB_DISPLAYNAME_REVERT , HUNK_TYPE_SPOB_DESCRIPTION , HUNK_TYPE_SPOB_DESCRIPTION_REVERT , HUNK_TYPE_SPOB_BAR , HUNK_TYPE_SPOB_BAR_REVERT , HUNK_TYPE_SPOB_SERVICE_ADD , HUNK_TYPE_SPOB_SERVICE_REMOVE , HUNK_TYPE_SPOB_NOMISNSPAWN_ADD , HUNK_TYPE_SPOB_NOMISNSPAWN_REMOVE , HUNK_TYPE_SPOB_TECH_ADD , HUNK_TYPE_SPOB_TECH_REMOVE , HUNK_TYPE_SPOB_TAG_ADD , HUNK_TYPE_SPOB_TAG_REMOVE , HUNK_TYPE_SPOB_SPACE , HUNK_TYPE_SPOB_SPACE_REVERT , HUNK_TYPE_SPOB_EXTERIOR , HUNK_TYPE_SPOB_EXTERIOR_REVERT , HUNK_TYPE_SPOB_LUA , HUNK_TYPE_SPOB_LUA_REVERT , HUNK_TYPE_FACTION_VISIBLE , HUNK_TYPE_FACTION_INVISIBLE , HUNK_TYPE_FACTION_ALLY , HUNK_TYPE_FACTION_ENEMY , HUNK_TYPE_FACTION_NEUTRAL , HUNK_TYPE_FACTION_REALIGN } |
| Represents the different type of hunk actions. More... | |
Functions | |
| static int | diff_applyInternal (const char *name, int oneshot) |
| Applies a diff to the universe. | |
| NONNULL (1) | |
| int | diff_loadAvailable (void) |
| Loads available universe diffs. | |
| int | diff_isApplied (const char *name) |
| Checks if a diff is currently applied. | |
| static UniDiff_t * | diff_get (const char *name) |
| Gets a diff by name. | |
| int | diff_apply (const char *name) |
| Applies a diff to the universe. | |
| static int | diff_patchSystem (UniDiff_t *diff, xmlNodePtr node) |
| Patches a system. | |
| static int | diff_patchTech (UniDiff_t *diff, xmlNodePtr node) |
| Patches a tech. | |
| static int | diff_patchSpob (UniDiff_t *diff, xmlNodePtr node) |
| Patches a spob. | |
| static int | diff_patchFaction (UniDiff_t *diff, xmlNodePtr node) |
| Patches a faction. | |
| static int | diff_patch (xmlNodePtr parent) |
| Actually applies a diff in XML node form. | |
| static int | diff_patchHunk (UniHunk_t *hunk) |
| Applies a hunk and adds it to the diff. | |
| static void | diff_hunkFailed (UniDiff_t *diff, UniHunk_t *hunk) |
| Adds a hunk to the failed list. | |
| static void | diff_hunkSuccess (UniDiff_t *diff, UniHunk_t *hunk) |
| Adds a hunk to the applied list. | |
| void | diff_remove (const char *name) |
| Removes a diff from the universe. | |
| void | diff_clear (void) |
| Removes all active diffs. (Call before economy_destroy().) | |
| void | diff_free (void) |
| Clean up after diff_loadAvailable(). | |
| static UniDiff_t * | diff_newDiff (void) |
| Creates a new UniDiff_t for usage. | |
| static int | diff_removeDiff (UniDiff_t *diff) |
| Removes a diff. | |
| static void | diff_cleanup (UniDiff_t *diff) |
| Cleans up a diff. | |
| static void | diff_cleanupHunk (UniHunk_t *hunk) |
| Cleans up a hunk. | |
| int | diff_save (xmlTextWriterPtr writer) |
| Saves the active diffs. | |
| int | diff_load (xmlNodePtr parent) |
| Loads the diffs. | |
| static int | diff_checkUpdateUniverse (void) |
| Checks and updates the universe if necessary. | |
| void | unidiff_universeDefer (int enable) |
| Sets whether or not to defer universe change stuff. | |
Variables | |
| static UniDiffData_t * | diff_available = NULL |
| static UniDiff_t * | diff_stack = NULL |
| static int | diff_universe_changed = 0 |
| static int | diff_universe_defer = 0 |
Handles the application and removal of 'diffs' to the universe.
Diffs allow changing spobs, factions, etc... in the universe. These are meant to be applied after the player triggers them, mostly through missions.
Definition in file unidiff.c.
| enum UniHunkTargetType_t |
| enum UniHunkType_t |
| int diff_apply | ( | const char * | name | ) |
|
static |
|
static |
|
static |
|
static |
| void diff_clear | ( | void | ) |
Removes all active diffs. (Call before economy_destroy().)
| void diff_free | ( | void | ) |
Clean up after diff_loadAvailable().
|
static |
| int diff_isApplied | ( | const char * | name | ) |
| int diff_load | ( | xmlNodePtr | parent | ) |
| int diff_loadAvailable | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| void diff_remove | ( | const char * | name | ) |
|
static |
| int diff_save | ( | xmlTextWriterPtr | writer | ) |
| void unidiff_universeDefer | ( | int | enable | ) |
|
static |
|
static |
|
static |