naev 0.11.5
slots.c File Reference

Handles the slot properties. More...

#include "slots.h"
#include "array.h"
#include "log.h"
#include "nxml.h"
#include "ndata.h"

Go to the source code of this file.

Data Structures

struct  SlotProperty_t
 Representation of a slot property. More...
 

Macros

#define SP_XML_ID   "slot"
 

Functions

static int sp_check (unsigned int spid)
 Checks to see if in bound of array.
 
int sp_load (void)
 Initializes the slot properties.
 
void sp_cleanup (void)
 Cleans up after the slot properties.
 
unsigned int sp_get (const char *name)
 Gets the id of a slot property.
 
const char * sp_display (unsigned int spid)
 Gets the display name of a slot property (in English).
 
const char * sp_description (unsigned int spid)
 Gets the description of a slot property (in English).
 
int sp_required (unsigned int spid)
 Gets whether or not a slot property is required.
 
int sp_exclusive (unsigned int spid)
 Gets whether or not a slot property is exclusive.
 
int sp_locked (unsigned int spid)
 Gets whether or not a slot property is locked.
 
const glTexturesp_icon (unsigned int spid)
 Gets the icon associated with the slot.
 

Variables

static SlotProperty_tsp_array = NULL
 

Detailed Description

Handles the slot properties.

Definition in file slots.c.

Macro Definition Documentation

◆ SP_XML_ID

#define SP_XML_ID   "slot"

SP XML node tag.

Definition at line 20 of file slots.c.

Function Documentation

◆ sp_check()

static int sp_check ( unsigned int spid)
static

Checks to see if in bound of array.

Definition at line 149 of file slots.c.

◆ sp_cleanup()

void sp_cleanup ( void )

Cleans up after the slot properties.

Definition at line 114 of file slots.c.

◆ sp_description()

const char * sp_description ( unsigned int spid)

Gets the description of a slot property (in English).

Definition at line 169 of file slots.c.

◆ sp_display()

const char * sp_display ( unsigned int spid)

Gets the display name of a slot property (in English).

Definition at line 159 of file slots.c.

◆ sp_exclusive()

int sp_exclusive ( unsigned int spid)

Gets whether or not a slot property is exclusive.

Definition at line 189 of file slots.c.

◆ sp_get()

unsigned int sp_get ( const char * name)

Gets the id of a slot property.

Parameters
nameName to match.
Returns
ID of the slot property.

Definition at line 133 of file slots.c.

◆ sp_icon()

const glTexture * sp_icon ( unsigned int spid)

Gets the icon associated with the slot.

Definition at line 209 of file slots.c.

◆ sp_load()

int sp_load ( void )

Initializes the slot properties.

Definition at line 45 of file slots.c.

◆ sp_locked()

int sp_locked ( unsigned int spid)

Gets whether or not a slot property is locked.

Definition at line 199 of file slots.c.

◆ sp_required()

int sp_required ( unsigned int spid)

Gets whether or not a slot property is required.

Definition at line 179 of file slots.c.

Variable Documentation

◆ sp_array

SlotProperty_t* sp_array = NULL
static

Slot property array.

Definition at line 35 of file slots.c.