/**
 * @class kActor
 * @brief Base type used by all actors.
 */
 
class kActor : ScriptObject
{
public:

	/**
	 * @brief Position in world space
	 */
	kVec3 &Origin();
	kAngle &Yaw();
	kAngle &Pitch();
	kAngle &Roll();
	kVec3 &Scale();
	
	/**
	 * @brief Casts actor to a particle if this actor is one else return null.
	 */
	kParticle@ CastToParticle();
	
	/**
	 * @brief Casts to actor else return null.
	 */
	kActor@ CastToActor();
	
	/**
	 * @brief Returns true if this instance has the same def name as \a actorDefName
	 */
	bool InstanceOf(const kStr &in actorDefName);
	
	/**
	 * @brief Returns this actors current target. Returns null if no target.
	 */
	kActor@ GetTarget(); 
	
	/**
	 * @brief Sets target to the \a particle
	 */
	void SetTarget(kParticle@ particle);
	
	/**
	 * @brief Sets target to the \a actor
	 */
	void SetTarget(kActor@ actor);
	
	/**
	 * @brief Casts actor to a puppet if this actor is one else return null.
	 */
	kPuppet@ CastToPuppet();
	
	/**
	 * @brief Returns this actors Network ID value
	 */
	int16 &NetID();
	
	/**
	 * @brief Returns deltaAngle from \a point in radians
	 */
	float GetDeltaFromPoint(const kVec3&in point);
	
	/**
	 * @brief Converts a Local Space to World Space
	 */
	kVec3 LocalVectorToWorldSpace(const kVec3&in localVector);
	
	/**
	 * @brief Remove this actor from the map.
	 */
	void Remove();
	
	/**
	 * @brief Get/Set to a value which is most commonly used by this actors ScriptObject::OnTrigger callback
	 */
	int &TriggerMessageID();
	
	/**
	 * @brief Get/Set to a value which is most commonly used by this actors ScriptObject::OnTrigger callback
	 */
	int &TriggerData();
	
	/**
	 * @brief Fires the ScriptObject::OnTrigger callback with a triggerer actor. Can use null if you don't want to specify a triggerer.
	 */
	void Trigger(kActor@ triggerer);
	
	/**
	 * @brief Actors Tag ID value
	 */
	int32 &TID();
	
	/**
	 * @brief Actors Def ID value
	 */
	int &Type();
	
	/**
	 * @brief Get/Set Health
	 */
	float &Health();
	
	/**
	 * @brief This actors current EnumActorFlags value
	 */
	EnumActorFlags &Flags();
	
	void PlaySound(const int soundID);
	void PlaySound(const kStr &in soundPath);
	void PlayLoopingSound(const int soundID);
	void PlayLoopingSound(const kStr &in soundPath);
	
	/**
	 * @brief Stops all sounds this actor is playing
	 */
	void StopSound();
	
	/**
	 * @brief Stops all looping sounds this actor is playing
	 */
	void StopLoopingSounds();
	
	/**
	 * @brief Mark This actor as being "On". If this actor was loaded from the map this bit/bool is saved can be used for loading without having to serialize or deserialize.
	 */
	void Mark(const bool isPersistent);
	
	/**
	 * @brief Has This actor been marked "On"
	 */
	const bool IsMarked();
	
	/**
	 * @brief Seems to be mainly used with kModeStateComponent for turning off the current mode
	 */
	void SignalOff();
	
	/**
	 * @brief Seems to be mainly used with kModeStateComponent for turning on the current mode
	 */
	void SignalOn();
	
	/**
	 * @brief Enables viewing of the actor in the gallery (by the actors def name?)
	 */
	void AddToGallery();
	
	/**
	 * @brief Spawns Pickup items using \a genFlags and a \a flagSet of either 0 or 1
	 */
	void GenerateActors(const uint genFlags, const uint flagSet);
	
	/**
	 * @brief Returns the Def data that the this actor was loaded from.
	 */
	kDictMem@ Definition();
	
	/**
	 * @brief The amount of ticks this actor has been active for.
	 */
	const int GameTicks();
	
	/**
	 * @brief Returns true if this actor was Deserialized (loaded from save game)
	 */
	const bool Deserialized();
	
	/**
	 * @brief Runs an actorfx on this actor with \a fxEventName
	 * @code{.cpp}
	 *	RunFxEvent("Blink")
	 * @endcode
	 */
	void RunFxEvent(const kStr &in fxEventName);
		//Example: RunFxEvent("Blink").
	
	/**
	 * @brief Enable/Disable a component on this actor
	 * @param componentName Name of the component. kexModeStateComponent, kexEnemyAIComponent, kexMovementComponent
	 * @param enable If true will enable the component else will disable it
	 */
	void EnableComponent(const kStr &in componentName, const bool enable);
	
	void AddComponent(const kStr &in componentName, const bool enable);
	
	/**
	 * @brief Returns true if component with \a componentName is on this actor
	 */
	const bool HasComponent(const kStr &in componentName);
	
	/**
	 * @brief Returns the kAnimTrackComponent on this actor or null if no component.
	 */
	kAnimTrackComponent@ AnimTrackComponent();
	
	/**
	 * @brief Returns the kWorldComponent on this actor or null if no component.
	 */
	kWorldComponent@ WorldComponent();
	
	/**
	 * @brief Returns the kEnemyAIComponent on this actor or null if no component.
	 */
	kEnemyAIComponent@ EnemyAIComponent();
	
	/**
	 * @brief Returns the kMovementComponent on this actor or null if no component.
	 */
	kMovementComponent@ MovementComponent();
	
	/**
	 * @brief Returns the kModeStateComponent on this actor or null if no component.
	 */
	kModeStateComponent@ ModeStateComponent();
	
	/**
	 * @brief Returns the kRenderMeshComponent on this actor or null if no component.
	 */
	kRenderMeshComponent@ RenderMeshComponent();
	
	/**
	 * @brief Inflicts damage to this actor invoking the OnPreDamage, OnDamage, OnDeath callbacks.
	 */
	void InflictDamage(kDamageInfo &in dmgInfo);
	
	/**
	 * @brief Returns true if this actor has been removed or is unusable.
	 */
	const bool IsStale();
};
