mirror of
https://github.com/zoriya/ForecastingVillage.git
synced 2026-05-28 08:57:52 +00:00
adding the ui display component and adding missing files to the Makefile
This commit is contained in:
+1
-1
@@ -272,7 +272,7 @@ add_executable(my_rpg
|
||||
src/components/dialog_holder.c
|
||||
include/components/dialog_holder.h
|
||||
src/systems/dialog_manager.c
|
||||
)
|
||||
src/components/ui_display_component.c include/components/ui_display_component.h)
|
||||
|
||||
add_compile_options(-W -Wall -Wextra -Wshadow)
|
||||
|
||||
|
||||
@@ -18,7 +18,10 @@ SRC = src/main.c \
|
||||
src/components/dialog_holder.c \
|
||||
src/systems/map_movement_system.c \
|
||||
src/systems/dialog_manager.c \
|
||||
src/systems/controllers/keyboard_controller_system.c
|
||||
src/systems/controllers/keyboard_controller_system.c \
|
||||
src/components/ui_display_component.c \
|
||||
src/components/health_component.c \
|
||||
src/components/health_methods.c
|
||||
|
||||
OBJ = $(SRC:%.c=%.o)
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** my_rpg
|
||||
** File description:
|
||||
** ui display component
|
||||
*/
|
||||
|
||||
#ifndef MY_RPG_UI_DISPLAY_COMPONENT_H
|
||||
#define MY_RPG_UI_DISPLAY_COMPONENT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "component.h"
|
||||
|
||||
struct ui_display_component
|
||||
{
|
||||
gc_component base;
|
||||
bool display_health;
|
||||
bool display_xp;
|
||||
};
|
||||
|
||||
extern const struct ui_display_component ui_display_component;
|
||||
|
||||
#endif //MY_RPG_UI_DISPLAY_COMPONENT_H
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** my_rpg
|
||||
** File description:
|
||||
** ui display component
|
||||
*/
|
||||
|
||||
#include "xml.h"
|
||||
#include "component.h"
|
||||
#include "components/ui_display_component.h"
|
||||
|
||||
static void ui_display_ctr(void *component, va_list args)
|
||||
{
|
||||
struct ui_display_component *cmp = (struct ui_display_component *)\
|
||||
component;
|
||||
(void)args;
|
||||
}
|
||||
|
||||
static void ui_display_fdctr(gc_entity *entity, gc_scene *scene, \
|
||||
void *component, node *n)
|
||||
{
|
||||
struct ui_display_component *cmp = (struct ui_display_component *)\
|
||||
component;
|
||||
|
||||
(void)scene;
|
||||
(void)entity;
|
||||
(void)n;
|
||||
}
|
||||
|
||||
static void ui_display_dtr(void *component)
|
||||
{
|
||||
(void)component;
|
||||
}
|
||||
|
||||
static char *ui_display_serialize(void *component)
|
||||
{
|
||||
(void)component;
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
const struct ui_display_component ui_display_component = {
|
||||
base: {
|
||||
name: "ui_display_component",
|
||||
size: sizeof(struct ui_display_component),
|
||||
dependencies: (char *[]){
|
||||
NULL
|
||||
},
|
||||
ctr: &ui_display_ctr,
|
||||
fdctr: &ui_display_fdctr,
|
||||
dtr: &ui_display_dtr,
|
||||
serialize: &ui_display_serialize,
|
||||
destroy: &component_destroy
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user