Ludum Dare 29
HackSoc's entry for the Ludum Dare Jam 29
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
item.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <stdbool.h>
#include <curses.h>
#include <string.h>
#include "item.h"
#include "utils.h"
#include "list.h"
Include dependency graph for item.c:

Functions

static const char ** inventory_name_array (List *inventory)
 
static const List ** inventory_array (List *inventory)
 
void display_inventory (List *inventory, const char *title)
 
List ** choose_items (List *inventory, const char *prompt)
 
Itemchoose_item_by_type (List *inventory, enum ItemType type, const char *prompt, bool no_equipped)
 

Function Documentation

Item* choose_item_by_type ( List inventory,
enum ItemType  type,
const char *  prompt,
bool  no_equipped 
)

Choose an item by type

Parameters
inventoryThe inventory to choose from
typeThe type of the item
promptThe prompt
no_equippedDon't include equipped things
Returns
NULL if nothing was selected, otherwise a pointer to the choice.

Here is the call graph for this function:

Here is the caller graph for this function:

List** choose_items ( List inventory,
const char *  prompt 
)

Choose some items from an inventory

Parameters
inventoryThe inventory to choose from
promptThe prompt to display

Here is the call graph for this function:

Here is the caller graph for this function:

void display_inventory ( List inventory,
const char *  title 
)

Display an inventory

Parameters
inventoryThe inventory to display
titleThe title to display

Here is the call graph for this function:

Here is the caller graph for this function:

static const List** inventory_array ( List inventory)
static

Convert an inventory doubly-linked list into an array of pointers to members of the inventory.

Parameters
inventoryThe inventory to convert

Here is the call graph for this function:

Here is the caller graph for this function:

static const char** inventory_name_array ( List inventory)
static

Convert an inventory doubly-linked list into an array of pointers to names of members of the inventory.

Parameters
inventoryThe inventory to convert

Here is the call graph for this function:

Here is the caller graph for this function: