eco2d/code/foundation/src/models/prefabs/furnace.c

25 lines
606 B
C
Raw Normal View History

2022-09-29 14:05:07 +00:00
#include "furnace.h"
2022-09-29 14:16:06 +00:00
#include "models/device.h"
2022-09-29 14:29:31 +00:00
#include "world/world.h"
2022-09-28 05:29:32 +00:00
2022-09-29 14:33:36 +00:00
#include "models/entity.h"
2022-09-29 14:16:06 +00:00
#include "models/components.h"
2022-09-28 05:29:32 +00:00
uint64_t furnace_spawn(void) {
ecs_entity_t e = device_spawn(ASSET_FURNACE);
2022-10-17 17:44:28 +00:00
2022-09-28 05:29:32 +00:00
ItemContainer *storage = ecs_get_mut(world_ecs(), e, ItemContainer);
*storage = (ItemContainer){0};
2022-10-17 17:44:28 +00:00
2022-09-29 15:35:43 +00:00
Producer *producer = ecs_get_mut(world_ecs(), e, Producer);
*producer = (Producer){0};
producer->energy_level = 69.0f;
2022-10-17 17:44:28 +00:00
ecs_add(world_ecs(), e, ItemRouter);
2022-09-28 05:29:32 +00:00
return (uint64_t)e;
}
void furnace_despawn(uint64_t ent_id) {
entity_despawn(ent_id);
}