Techneck/code/source-c/entity/player.c

41 lines
1.0 KiB
C
Raw Normal View History

2023-10-14 13:04:52 +00:00
#include "registration.h"
2023-10-15 12:41:53 +00:00
#include <state.h>
2023-10-14 13:04:52 +00:00
#include <stdlib.h>
tc_entity_type_s *tc_player_entity_type_g = NULL;
2023-10-15 09:51:45 +00:00
void tc_fn_create_player_entity(tc_entity_s *entity)
2023-10-14 13:04:52 +00:00
{
entity->type = tc_player_entity_type_g;
entity->specific = NULL;
}
void tc_fn_delete_player_entity(tc_entity_s *entity)
{
if(entity->specific != NULL) free(entity->specific);
tc_deallocate_entity(entity);
}
void tc_fn_send_event_player_entity(tc_entity_s *entity, tc_entity_event_s event)
{
}
void tc_register_player_entity()
{
tc_entity_type_s type;
type.internal_name = "player";
type.display_name = "Player";
2023-10-15 09:51:45 +00:00
type.instances_capacity = 8;
2023-10-17 11:25:02 +00:00
type.functions.fn_create = (tc_entity_create_fn) tc_fn_create_player_entity;
2023-10-14 13:04:52 +00:00
type.functions.fn_delete = tc_fn_delete_player_entity;
type.functions.fn_send_event = tc_fn_send_event_player_entity;
tc_register_entity_type(type);
2023-10-14 14:38:38 +00:00
tc_player_entity_type_g = tc_get_entity_type_with_name("player");
2023-10-14 13:04:52 +00:00
}