summaryrefslogtreecommitdiff
path: root/src/puzzles/puzzle.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/puzzles/puzzle.h')
-rw-r--r--src/puzzles/puzzle.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/puzzles/puzzle.h b/src/puzzles/puzzle.h
index cea0dba..21d8944 100644
--- a/src/puzzles/puzzle.h
+++ b/src/puzzles/puzzle.h
@@ -99,18 +99,26 @@ typedef enum {
COLLECTION_ELEMENT_UNKNOWN
} CollectionElementType;
+
typedef struct CollectionElement {
Texture2D icon;
+ Rectangle _previousFramePosition;
char *path;
char *name;
struct CollectionElement *children;
+ void (*callback)(struct CollectionElement *);
size_t childCount;
bool IsInitialized;
bool hasIcon;
+ bool isPressed;
CollectionElementType type;
} CollectionElement;
-void InitializeCollection(CollectionElement *el);
+/// Accepts an element which children will be created and a generic callback that
+/// will be called when the collection enement is selected.
+/// The element passes a selected element as a callback argummment
+void InitializeCollection(CollectionElement *el, void (*callback)(CollectionElement *));
void DrawCollectionElement(CollectionElement *el, CollectionElement *parent, Rectangle rec);
+void UpdateCollectionElement(CollectionElement *el);
#endif // PUZZLE_H