Esempio n. 1
0
        public Waiting()
        {
            var waitingFrames = new IAnimationFrame[]
            {
                new AnimationFrame(new FrameInformation(118, 6, 32, 39), 500),
                new AnimationFrame(new FrameInformation(231, 6, 32, 39), 500)
            };

            var fallingAsleepFrames = new IAnimationFrame[]
            {
                new AnimationFrame(new FrameInformation(192, 6, 32, 39), 500),
                new AnimationFrame(new FrameInformation(271, 6, 32, 39), 500)
            };

            var sleepingFrame = new FrameInformation(81, 6, 31, 39);
            var wakeUpFrame = new FrameInformation(157, 6, 32, 39);

            _animation = new Animation(new IAnimationFrame[]
            {
                new LimitedAnimation(waitingFrames, 10),
                new LimitedAnimation(fallingAsleepFrames, 10),
                new AnimationFrame(sleepingFrame, 3000),
                new AnimationFrame(wakeUpFrame, 500)
            });
        }
 public LimitedAnimation(IAnimationFrame[] frames, int iterations)
 {
     _maxIterations = iterations;
     _animation = new Animation(frames);
     _totalMilliseconds = frames.Sum(f => f.TotalMilliseconds) * iterations;
     _firstFrame = frames.First();
     _lastFrame = frames.Last();
 }
Esempio n. 3
0
 private IAnimationFrame[] CheckCache(int body, int action, int direction)
 {
     // Make sure the cache is complete.
     if (m_Cache[body] == null)
         m_Cache[body] = new IAnimationFrame[COUNT_ACTIONS][][]; // max 35 actions
     if (m_Cache[body][action] == null)
         m_Cache[body][action] = new IAnimationFrame[COUNT_DIRECTIONS][];
     if (m_Cache[body][action][direction] == null)
         m_Cache[body][action][direction] = new IAnimationFrame[1];
     if (m_Cache[body][action][direction][0] != null)
         return m_Cache[body][action][direction];
     else
         return null;
 }
Esempio n. 4
0
 public MobileViewLayer(int bodyID, int hue, IAnimationFrame frame)
 {
     BodyID = bodyID;
     Hue = hue;
     Frame = frame;
 }
 private IAnimationFrame[] CheckCache(int body, int action, int direction)
 {
     // Make sure the cache is complete.
     // max number of bodies is about 0x1000
     if (m_Cache == null) m_Cache = new IAnimationFrame[0x1000][][][];
     if (m_Cache[body] == null)
         m_Cache[body] = new IAnimationFrame[35][][];
     if (m_Cache[body][action] == null)
         m_Cache[body][action] = new IAnimationFrame[8][];
     if (m_Cache[body][action][direction] == null)
         m_Cache[body][action][direction] = new IAnimationFrame[1];
     if (m_Cache[body][action][direction][0] != null)
         return m_Cache[body][action][direction];
     else
         return null;
 }
Esempio n. 6
0
 public MobileViewLayer(int bodyID, int hue, IAnimationFrame frame)
 {
     BodyID = bodyID;
     Hue    = hue;
     Frame  = frame;
 }
Esempio n. 7
0
 public void SetSeries(string seriesName, IAnimationFrame frame)
 {
     Series.Add(seriesName);
     frames.Add(seriesName, frame);
     Values.Add(seriesName, frame.FrameValue);
 }
Esempio n. 8
0
 public Animation(IAnimationFrame[] frames)
 {
     _frames = frames;
 }
Esempio n. 9
0
 private int getTimeForNextFrame(IAnimationFrame frame)
 {
     int delay = frame.Delay + Configuration.DelayBetweenFrames;
     if (delay < 0) delay = 0;
     return delay;
 }