feat: reorganize the code
This commit is contained in:
parent
a00a02e527
commit
5103cbf709
40 changed files with 326 additions and 325 deletions
25
includes/utils/direction.h
Normal file
25
includes/utils/direction.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* direction.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/04/02 17:28:40 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 17:28:56 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef DIRECTION_H
|
||||
# define DIRECTION_H
|
||||
|
||||
typedef enum e_direction
|
||||
{
|
||||
DOWN,
|
||||
UP,
|
||||
LEFT,
|
||||
RIGHT,
|
||||
NO_DIRECTION
|
||||
} t_direction;
|
||||
|
||||
#endif
|
||||
27
includes/utils/point.h
Normal file
27
includes/utils/point.h
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* point.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/15 15:05:03 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/04/02 14:39:41 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef POINT_H
|
||||
# define POINT_H
|
||||
|
||||
typedef struct s_point
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
} t_point;
|
||||
|
||||
t_point point_init(int x, int y);
|
||||
void point_addto(t_point *dest, t_point src);
|
||||
t_point point_fromdirection(t_direction direction);
|
||||
t_point point_multiply(t_point point, int x);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue