Merging the health component

This commit is contained in:
Anonymus Raccoon
2020-04-01 16:45:37 +02:00
3 changed files with 88 additions and 0 deletions
+11
View File
@@ -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
)
+21
View File
@@ -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
+56
View File
@@ -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
}
};