diff --git a/CMakeLists.txt b/CMakeLists.txt index f12f879..c4282c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,6 +259,17 @@ add_executable(my_rpg lib/gamacon/include/tile.h src/components/dialog_holder.c include/components/dialog_holder.h + lib/gamacon/include/components/map_linker.h + lib/gamacon/src/systems/map_linker_system.c + src/components/health_component.c + include/components/health_component.h + lib/gamacon/src/sfml_renderer/sfml_utilities.c + lib/gamacon/src/components/map_linker.c + lib/gamacon/include/components/map_linker.h + lib/gamacon/src/systems/map_linker_system.c + lib/gamacon/include/tile.h + src/components/dialog_holder.c + include/components/dialog_holder.h src/systems/dialog_manager.c ) diff --git a/include/components/health_component.h b/include/components/health_component.h new file mode 100644 index 0000000..1c850cd --- /dev/null +++ b/include/components/health_component.h @@ -0,0 +1,21 @@ +/* +** EPITECH PROJECT, 2019 +** Gamacon +** File description: +** health_component +*/ + +#ifndef MY_RPG_HEALTH_COMPONENT_H +#define MY_RPG_HEALTH_COMPONENT_H + +#include "component.h" + +struct health_component +{ + gc_component base; + unsigned int health; +}; + +extern const struct health_component health_component; + +#endif //MY_RPG_HEALTH_COMPONENT_H diff --git a/src/components/health_component.c b/src/components/health_component.c new file mode 100644 index 0000000..9e6f7dc --- /dev/null +++ b/src/components/health_component.c @@ -0,0 +1,56 @@ +/* +** EPITECH PROJECT, 2020 +** My3D +** File description: +** health component +*/ + +#include "xml.h" +#include "component.h" +#include "components/health_component.h" + +static void health_ctr(void *component, va_list args) +{ + struct controllable_component *cmp = (struct controllable_component *)\ +component; + + (void)args; +} + +static void health_fdctr(gc_entity *entity, gc_scene *scene, \ +void *component, node *n) +{ + struct controllable_component *cmp = (struct controllable_component *)\ +component; + + (void)scene; + (void)entity; + (void)n; +} + +static void health_dtr(void *component) +{ + (void)component; +} + +static char *health_serialize(void *component) +{ + (void)component; + return (NULL); +} + +const struct health_component health_component = { + base: { + name: "health_component", + size: sizeof(struct health_component), + dependencies: (char *[]){ + "event_component", + NULL + }, + ctr: &health_ctr, + fdctr: &health_fdctr, + dtr: &health_dtr, + serialize: &health_serialize, + destroy: &component_destroy + } +}; \ No newline at end of file