#ifndef EDITSCENE_CHARACTERSPAWNER_HPP
#define EDITSCENE_CHARACTERSPAWNER_HPP
#pragma once

#include <cstdint>

/**
 * @brief Distance-based character spawner.
 *
 * Attaches to an entity with a TransformComponent. When the active camera is
 * within spawnDistanceSq of the spawner, the registry character identified by
 * registryId is spawned as an independent entity at the spawner's transform.
 * When the camera moves beyond despawnDistanceSq, the spawned entity is
 * destroyed.
 *
 * Distances are stored squared for fast comparison.
 */
struct CharacterSpawnerComponent {
	/** Registry character ID to spawn. */
	uint64_t registryId = 0;

	/** Squared distance at which the character should be spawned. */
	float spawnDistanceSq = 100.0f * 100.0f;

	/** Squared distance at which the character should be despawned. */
	float despawnDistanceSq = 200.0f * 200.0f;
};

#endif // EDITSCENE_CHARACTERSPAWNER_HPP
