/**
 * @class ScriptObject
 * @brief The base class for all scripts. Not inheriting from this class will cause an error in online multiplayer matches. Offline MP and SP will be fine though.
 */
 
class ScriptObject
{
public:

	/**
	 * @brief Never gets called
	 */
	void OnBeginLevel();
	
	/**
	 * @brief Called on every actor tick/frame
	 */
	void OnTick();
	
	/**
	 * @brief Never gets called
	 */
	void OnEndLevel();
	
	/**
	 * @brief Called just after actor is created on the map.
	 */
	void OnSpawn();
	
	/**
	 * @brief Called before ScriptObject::OnDamage and ScriptObject::OnDeath
	 */
	void OnPreDamage(kDamageInfo& in dmgInfo);
	
	/**
	 * @brief Called after OnDeath and OnPreDamage. Health is reduced after this is called which means after an OnDeath call the remaining Health will always be negative of the damage taken.
	 * This is never called if an actor of the same kActor::Type() ID damages another actor of the same Type() ID. But PreDamage is still called.
	 */
	void OnDamage(kDamageInfo& in dmgInfo);
	
	/**
	 * @brief Called when actor is loaded from the map. Not called when Loading a save game.
	 */
	void OnLevelLoad(kDictMem@ pDict);
	
	/**
	 * @brief Called after OnPreDamage and before OnDamage.
	 */
	void OnDeath(kDamageInfo& in dmgInfo);
	
	/**
	 * @brief Called when 2 actors collision radius are touching and touch callback is enabled for this actor.
	 */
	void OnTouch(kActor@ pInstigator);
	
	/**
	 * @brief Called by kexEventLinkComponents when they are triggered. Can also be called by calling kActor::Trigger 
	 */
	void OnTrigger(kActor@ pInstigator, const int msg);
	
	/**
	 * @brief Called by calling kEvent::RunAction or through animations and particles.
	 */
	void UserEvent(const float x, const float y, const float z, const float f1, const float f2, const float f3, const float f4);
	
	/**
	 * @brief Called when the actor has collision callbacks enabled and the actors are solid and there collision radius are touching.
	 */
	void OnCollide(kActor@ pCollider);
	
	/**
	 * @brief Called just before the game is saved. You can populate the dict with any keys/values to keep the actors state on load.
	 * @param dict Contains the custom properties to save
	 */
	void OnSerialize(kDict& out dict);
	
	/**
	 * @brief Called after the game is loaded from a save. The dict will contain keys/values that you populated it with in ScriptObject::OnSerialize
	 * @param dict Contains the custom properties the actor had
	 */
	void OnDeserialize(kDict& in dict);
};
