public void RemoveTileAnimation(TileAnimationKind kind, Point position, bool looping)
 {
     TileAnimation animation = new TileAnimation();
     animation.Kind = kind;
     animation.Looping = looping;
     animation.Position = position;
     this.TileAnimations.Remove(animation.GetHashCode());
 }
 public bool HasTileAnimation(TileAnimationKind kind, Point position, bool looping)
 {
     TileAnimation animation = new TileAnimation();
     animation.Kind = kind;
     animation.Looping = looping;
     animation.Position = position;
     return this.TileAnimations.ContainsKey(animation.GetHashCode());
 }
        public void RemoveTileAnimation(TileAnimationKind kind, Point position, bool looping)
        {
            TileAnimation animation = new TileAnimation();

            animation.Kind     = kind;
            animation.Looping  = looping;
            animation.Position = position;
            this.TileAnimations.Remove(animation.GetHashCode());
        }
        public bool HasTileAnimation(TileAnimationKind kind, Point position, bool looping)
        {
            TileAnimation animation = new TileAnimation();

            animation.Kind     = kind;
            animation.Looping  = looping;
            animation.Position = position;
            return(this.TileAnimations.ContainsKey(animation.GetHashCode()));
        }
 public TileAnimation AddTileAnimation(TileAnimationKind kind, Point position, bool looping)
 {
     TileAnimation animation = new TileAnimation();
     animation.Kind = kind;
     animation.Looping = looping;
     animation.Position = position;
     int hashCode = animation.GetHashCode();
     if (!this.TileAnimations.ContainsKey(hashCode))
     {
         animation.LinkedAnimation = this.Scenario.GameCommonData.AllTileAnimations.GetAnimation((int) kind);
         animation.Drawing = true;
         animation.currentFrameIndex = 0;
         animation.currentStayIndex = 0;
         this.TileAnimations.Add(hashCode, animation);
         return animation;
     }
     return null;
 }
        public TileAnimation AddTileAnimation(TileAnimationKind kind, Point position, bool looping)
        {
            TileAnimation animation = new TileAnimation();

            animation.Kind     = kind;
            animation.Looping  = looping;
            animation.Position = position;
            int hashCode = animation.GetHashCode();

            if (!this.TileAnimations.ContainsKey(hashCode))
            {
                animation.LinkedAnimation   = this.Scenario.GameCommonData.AllTileAnimations.GetAnimation((int)kind);
                animation.Drawing           = true;
                animation.currentFrameIndex = 0;
                animation.currentStayIndex  = 0;
                this.TileAnimations.Add(hashCode, animation);
                return(animation);
            }
            return(null);
        }
Exemple #7
0
        public void SetStatus(TroopStatus ts)
        {
            this.status = ts;
            switch (ts)
            {
                case TroopStatus.一般:
                    this.CurrentTileAnimationKind = TileAnimationKind.无;
                    break;

                case TroopStatus.混乱:
                    this.CurrentTileAnimationKind = TileAnimationKind.混乱;
                    break;

                case TroopStatus.埋伏:
                    this.CurrentTileAnimationKind = TileAnimationKind.埋伏;
                    break;
            }
        }