Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
 /// <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));
 }
Exemplo n.º 3
0
 /// <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;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Clears the animation override.
 /// </summary>
 public virtual void ClearAnimationOverride()
 {
     IsAnimationOverridden = false;
     ComponentInControl = null;
     HandleDerivedAnimation();
 }
Exemplo n.º 5
0
 /// <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);
 }