Exemplo n.º 1
0
        //
        // Contracts
        //

        /// <summary>
        ///		Implements what the animation will actually perform
        /// </summary>
        protected override void Animate()
        {
            // Change the SpriteEntity's Image
            AnimationUnitFrame currUnit = this.currentUnit as AnimationUnitFrame;

            Debug.Assert(currUnit != null);
            this.spriteTarget.SetMapping(currUnit.ImageReference);
        }
Exemplo n.º 2
0
        /// <summary>
        ///		Attaches an Image to the frame animation
        /// </summary>
        /// <param name="newImage"></param>
        /// <returns></returns>
        public AnimationUnitFrame Attach(Image newImage)
        {
            AnimationUnitFrame newUnit = this.BaseAttach(0u) as AnimationUnitFrame;

            newUnit.SetImage(newImage);
            this.PointToStartingAnimationUnit();
            return(newUnit);
        }
Exemplo n.º 3
0
 // Prefills the pool with the given number of elements
 protected override void FillReserve(int fillSize)
 {
     for (int i = fillSize; i > 0; i--)
     {
         AnimationUnitFrame newNode = new AnimationUnitFrame();
         this.reservedList.PushFront(newNode);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        ///		Attaches an Image to the frame animation
        /// </summary>
        /// <param name="imageName"></param>
        /// <returns></returns>
        public AnimationUnitFrame Attach(Image.Name imageName)
        {
            Image newImage             = ImageManager.Self.Find(imageName);
            AnimationUnitFrame newUnit = this.BaseAttach(0u) as AnimationUnitFrame;

            newUnit.SetImage(newImage);
            this.PointToStartingAnimationUnit();
            return(newUnit);
        }
Exemplo n.º 5
0
        /// <summary>
        ///		Removes an Image from the frame animation
        /// </summary>
        /// <param name="oldName"></param>
        /// <returns></returns>
        public bool Detach(Image.Name oldName)
        {
            AnimationUnitFrame oldUnit = this.BaseDetach(oldName, 0u) as AnimationUnitFrame;

            if (oldUnit == null)
            {
                return(false);
            }
            oldUnit.Reset();
            return(true);
        }