diff options
Diffstat (limited to 'src/puzzles/puzzle.h')
| -rw-r--r-- | src/puzzles/puzzle.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/puzzles/puzzle.h b/src/puzzles/puzzle.h index 21d8944..5af6d6e 100644 --- a/src/puzzles/puzzle.h +++ b/src/puzzles/puzzle.h @@ -100,17 +100,27 @@ typedef enum { } CollectionElementType; +/// A collection node. Corresponds to either a directory in the FS or a .pz file typedef struct CollectionElement { + /// The icon used for the puzzles in the collection Texture2D icon; + /// Used in the click detection. Do not modify from user space Rectangle _previousFramePosition; + /// The path to the directory/puzzle char *path; + /// The display name of an element char *name; + /// The tree child nodes array struct CollectionElement *children; - void (*callback)(struct CollectionElement *); + /// The tree child nodes count size_t childCount; + /// OnClick callback + void (*callback)(struct CollectionElement *); + /// If the element is initialized it has children and an icon loaded into mem bool IsInitialized; + /// The element has an icon bool hasIcon; - bool isPressed; + /// The type of the element CollectionElementType type; } CollectionElement; @@ -120,5 +130,6 @@ typedef struct CollectionElement { void InitializeCollection(CollectionElement *el, void (*callback)(CollectionElement *)); void DrawCollectionElement(CollectionElement *el, CollectionElement *parent, Rectangle rec); void UpdateCollectionElement(CollectionElement *el); +void DeinitCollectionElement(CollectionElement *el); #endif // PUZZLE_H |
