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

23 lines
552 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);
ItemContainer *storage = ecs_get_mut(world_ecs(), e, ItemContainer);
*storage = (ItemContainer){0};
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-09-28 05:29:32 +00:00
return (uint64_t)e;
}
void furnace_despawn(uint64_t ent_id) {
entity_despawn(ent_id);
}