Handles claiming of systems.
More...
#include "claim.h"
#include "array.h"
#include "event.h"
#include "log.h"
#include "mission.h"
#include "space.h"
Go to the source code of this file.
|
| Claim_t * | claim_create (int exclusive) |
| | Creates a system claim.
|
| int | claim_addStr (Claim_t *claim, const char *str) |
| | Adds a string claim to a claim.
|
| int | claim_addSys (Claim_t *claim, int ss_id) |
| | Adds a claim to a system claim.
|
| int | claim_isNull (const Claim_t *claim) |
| | See if a claim actually contains data.
|
| int | claim_test (const Claim_t *claim) |
| | Tests to see if a system claim would have collisions.
|
| int | claim_testStr (const Claim_t *claim, const char *str) |
| | Tests to see if a system is claimed by a system claim.
|
| int | claim_testSys (const Claim_t *claim, int sys) |
| | Tests to see if a system is claimed by a system claim.
|
| void | claim_destroy (Claim_t *claim) |
| | Destroys a system claim.
|
| void | claim_clear (void) |
| | Clears the claims on all systems.
|
| void | claim_activateAll (void) |
| | Activates all the claims.
|
| void | claim_activate (Claim_t *claim) |
| | Activates a claim on a system.
|
| int | claim_xmlSave (xmlTextWriterPtr writer, const Claim_t *claim) |
| | Saves all the systems in a claim in XML.
|
| Claim_t * | claim_xmlLoad (xmlNodePtr parent) |
| | Loads a claim.
|
Handles claiming of systems.
Definition in file claim.c.
◆ claim_activate()
| void claim_activate |
( |
Claim_t * | claim | ) |
|
Activates a claim on a system.
- Parameters
-
Definition at line 252 of file claim.c.
◆ claim_activateAll()
| void claim_activateAll |
( |
void | | ) |
|
Activates all the claims.
Definition at line 240 of file claim.c.
◆ claim_addStr()
| int claim_addStr |
( |
Claim_t * | claim, |
|
|
const char * | str ) |
Adds a string claim to a claim.
- Parameters
-
| claim | Claim to add system to. |
| str | String to claim. |
Definition at line 59 of file claim.c.
◆ claim_addSys()
| int claim_addSys |
( |
Claim_t * | claim, |
|
|
int | ss_id ) |
Adds a claim to a system claim.
- Parameters
-
| claim | Claim to add system to. |
| ss_id | Id of the system to add to the claim. |
Definition at line 77 of file claim.c.
◆ claim_clear()
| void claim_clear |
( |
void | | ) |
|
Clears the claims on all systems.
Definition at line 222 of file claim.c.
◆ claim_create()
| Claim_t * claim_create |
( |
int | exclusive | ) |
|
Creates a system claim.
- Parameters
-
| exclusive | Whether or not this claim is exclusive. |
- Returns
- Newly created system claim or NULL on error.
Definition at line 42 of file claim.c.
◆ claim_destroy()
| void claim_destroy |
( |
Claim_t * | claim | ) |
|
Destroys a system claim.
- Parameters
-
| claim | System claim to destroy. |
Definition at line 189 of file claim.c.
◆ claim_isNull()
| int claim_isNull |
( |
const Claim_t * | claim | ) |
|
See if a claim actually contains data.
- Parameters
-
- Returns
- 0 if claim contains something, 1 otherwise.
Definition at line 95 of file claim.c.
◆ claim_test()
| int claim_test |
( |
const Claim_t * | claim | ) |
|
Tests to see if a system claim would have collisions.
- Parameters
-
- Returns
- 0 if no collision found, 1 if a collision was found.
Definition at line 112 of file claim.c.
◆ claim_testStr()
| int claim_testStr |
( |
const Claim_t * | claim, |
|
|
const char * | str ) |
Tests to see if a system is claimed by a system claim.
- Parameters
-
| claim | Claim to test. |
| str | Stringto see if is claimed by the claim. |
- Returns
- 0 if no collision is found, 1 otherwise.
Definition at line 148 of file claim.c.
◆ claim_testSys()
| int claim_testSys |
( |
const Claim_t * | claim, |
|
|
int | sys ) |
Tests to see if a system is claimed by a system claim.
- Parameters
-
| claim | System claim to test. |
| sys | System to see if is claimed by the system claim. |
- Returns
- 0 if no collision is found, 1 otherwise.
Definition at line 170 of file claim.c.
◆ claim_xmlLoad()
| Claim_t * claim_xmlLoad |
( |
xmlNodePtr | parent | ) |
|
Loads a claim.
- Parameters
-
| parent | Parent node containing the claim data. |
- Returns
- The system claim.
Definition at line 306 of file claim.c.
◆ claim_xmlSave()
| int claim_xmlSave |
( |
xmlTextWriterPtr | writer, |
|
|
const Claim_t * | claim ) |
Saves all the systems in a claim in XML.
Use between xmlw_startElem and xmlw_endElem.
- Parameters
-
| writer | XML Writer to use. |
| claim | Claim to save. |
Definition at line 279 of file claim.c.
◆ claimed_strs
| char** claimed_strs = NULL |
|
static |
Global claimed strings.
Definition at line 34 of file claim.c.