/// <summary> /// Overrides the entity's animation. /// </summary> /// <param name="component">The component that's to be in charge of the animation.</param> /// <param name="animation">The animation to use as the override.</param> public virtual void OverrideAnimation(Component component, Animation animation) { IsAnimationOverridden = true; ComponentInControl = component; CurrentAnimation = animation; }
/// <summary> /// Overrides the entity's animation. /// </summary> /// <param name="component">The component that's to be in charge of the animation..</param> /// <param name="id">The identifier of the animation to be pulled from the cache.</param> public virtual void OverrideAnimation(Component component, string id) { OverrideAnimation(component, AnimationCache.GetAnimation(id)); }
/// <summary> /// Adds the component. /// </summary> /// <param name="id">The component's identifier.</param> /// <param name="component">The component to add.</param> public void AddComponent(string id, Component component) { Components.Add(id, component); component.Owner = this; }
/// <summary> /// Clears the animation override. /// </summary> public virtual void ClearAnimationOverride() { IsAnimationOverridden = false; ComponentInControl = null; HandleDerivedAnimation(); }
/// <summary> /// Adds the component to the entity's list of components. /// </summary> /// <param name="component">The component to add.</param> public void AddComponent(Component component) { AddComponent(component.GetType().Name, component); }