transfered from codeberg

This commit is contained in:
2026-03-26 14:46:39 -05:00
parent 630f28bb7e
commit 5ed2173793
136 changed files with 14932 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
#include "inventory.h"
#include <string.h>
/**
* Prepares an inventory for use by zeroing out all slots.
* This function ensures that every item_struct within the inventory
* is initialized to an 'empty' or 'null' state to prevent undefined behavior.
*/
void create_inventory(inventory_struct *inventory)
{
memset(inventory, 0, sizeof(inventory_struct));
}

View File

@@ -0,0 +1,25 @@
#ifndef inventory_h
#define inventory_h
#include "item.h"
#define inventory_size 36
/**
* A container structure that manages a fixed collection of items.
* This structure acts as the primary data storage for player belongings,
* including the hotbar and the main storage slots.
*/
typedef struct inventory_struct
{
item_struct slots[inventory_size];
} inventory_struct;
/**
* Prepares an inventory for use by zeroing out all slots.
* This function ensures that every item_struct within the inventory
* is initialized to an 'empty' or 'null' state to prevent undefined behavior.
*/
void create_inventory(inventory_struct *inventory);
#endif