42_so_long/includes/room/object.h
mcolonna 7ec3eb6841 feat: add exit (without game over screen) *
also:
- fix: walk_through's prototype
- misc: remove ketchup debug thing
- dev: rename room_patch -> room_fromfile3
2024-04-08 15:37:47 +02:00

37 lines
1.5 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* object.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/15 14:58:25 by mcolonna #+# #+# */
/* Updated: 2024/04/08 15:35:33 by mcolonna ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef OBJECT_H
# define OBJECT_H
typedef struct s_object t_object;
typedef struct s_character t_character;
typedef struct s_objecttype
{
t_point (*loop)(t_object *, t_point pos);
void (*draw)(t_object *, int x, int y);
// Called when a character want to walk through this object.
// Returns false to block the character. If true, it will pass.
// If walk_through is NULL, the character is blocked.
bool (*walk_through)(t_object *, t_character *, t_point pos);
} t_objecttype;
typedef struct s_object
{
t_objecttype type;
void *data;
} t_object;
typedef t_object (*t_object_init)(t_memclass);
#endif