예제 #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);
        }
예제 #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);
        }
예제 #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);
     }
 }
예제 #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);
        }
예제 #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);
        }