GBAlatro
A Demake of Balatro for the GBA
Loading...
Searching...
No Matches
Item Struct Reference

A generic interface for all items that can appear in the shop or be in the inventory. This uses first member struct inheritance - other structs are meant to inherit it by making their first member field Item. Then casts from inheriting structs to Item* are allowed and intentional and this allows for generic code that uses polymorphism. The -fms-extensions compile flag allows for anonymous members making it behave fully as inheritance. It makes all member fields be fully inherited so any struct that inherits Item for example will have all its fields accessible directly, e.g. JokerObject joker_object; joker_object.type = ITEM_TYPE_JOKER More...

#include <item.h>

Data Fields

 SpriteObject
 First member struct inheritance all items that can appear in the shop are SpriteObjects. Note that this is an anonymous member.
 
enum ItemType type
 The item type - used to dispatch the function implementations for inheriting types.
 

Detailed Description

A generic interface for all items that can appear in the shop or be in the inventory. This uses first member struct inheritance - other structs are meant to inherit it by making their first member field Item. Then casts from inheriting structs to Item* are allowed and intentional and this allows for generic code that uses polymorphism. The -fms-extensions compile flag allows for anonymous members making it behave fully as inheritance. It makes all member fields be fully inherited so any struct that inherits Item for example will have all its fields accessible directly, e.g. JokerObject joker_object; joker_object.type = ITEM_TYPE_JOKER

Definition at line 75 of file item.h.

Field Documentation

◆ SpriteObject

First member struct inheritance all items that can appear in the shop are SpriteObjects. Note that this is an anonymous member.

Definition at line 82 of file item.h.

◆ type

enum ItemType type

The item type - used to dispatch the function implementations for inheriting types.

Definition at line 87 of file item.h.


The documentation for this struct was generated from the following file: