示例#1
0
 public Coroutine(AnimatedCursor parent, ICursor cursor)
 {
     Parent        = parent;
     Cursor        = cursor;
     Current       = null;
     TextureIndex  = 0;
     SecondsToWait = 1f / parent.config.Speed;
 }
示例#2
0
        public void Write(IContent writable, AnimatedCursor animatedCursor)
        {
            if (writable == null)
            {
                throw new ArgumentNullException(nameof(writable));
            }
            if (animatedCursor == null)
            {
                throw new ArgumentNullException(nameof(animatedCursor));
            }

            WriteConfig(writable, animatedCursor.Config);
            WriteTextures(writable, animatedCursor.Textures);
        }
示例#3
0
        public void Test()
        {
            var factroy       = new AnimatedCursorFactroy();
            var memoryContent = new MemoryContent();
            var defaultCursor = new AnimatedCursor(defaultConfig, defaultTextures);

            using (memoryContent.BeginUpdateAuto())
            {
                factroy.Write(memoryContent, defaultCursor);
            }

            var cursor2 = factroy.Read(memoryContent);

            Assert.AreEqual(defaultConfig, cursor2.Config);
            AreEqual(defaultTextures, cursor2.Textures);
        }