Example #1
0
        public static void SaveMap(Frames.MapFrame frame)
        {
            try
            {
                lock (connectionLocker)
                {
                    Connect();

                    var text = "DELETE FROM maps WHERE id=" + frame.ID;
                    var command = new MySqlCommand(text, connection);

                    command.ExecuteNonQuery();

                    text = "INSERT INTO maps (id, date, width, heigth, places, mapData, monsters, capabilities, mappos, numgroup) VALUES ( '" +
                            frame.ID + "', '" + frame.signature + "', '" + frame.width + "', '" + frame.height + "', '" + frame.GetCellsFight(true) + "', '" +
                            frame.compressMap() + "', '', '" + frame.getCapabilities() + "', '0,0,0', '5');";
                    command = new MySqlCommand(text, connection);

                    command.ExecuteNonQuery();

                    Disconnect();
                }
            }
            catch (Exception e)
            {
                throw new Exception(e.ToString());
            }
        }
Example #2
0
        public CameraInfo(Frames.FrameCamera item)
        {
            if (item.LensRadius > 0f)
                LensRadius = item.LensRadius;
            Position = (Point) item.Position;
            Direction = item.Target;
            Up = item.Up;
            Pinhole = !item.FiniteApperture;

            CameraName = item.Name;
            if (item.Fov > 0f)
                Fov = item.Fov;
        }
Example #3
0
        private void ImportAndSeek()
        {
            if (_cancelled)
            {
                return;
            }

            lock (_lock)
            {
                var drawingVisual = new DrawingVisual();

                using (var dc = drawingVisual.RenderOpen())
                    dc.DrawVideo(_lowerPlayer, new Rect(0, 0, VideoWidth, VideoHeight));

                _lowerRenderTargetBitmap.Render(drawingVisual);

                //Create an unique file name.
                string fileName;
                do
                {
                    fileName = $"{Frames.Count} {DateTime.Now:yyMMdd-hhmmssffff}.png";
                }while (File.Exists(Path.Combine(RootFolder, fileName)));

                //Save the file to disk.
                using (var fileStream = new FileStream(Path.Combine(RootFolder, fileName), FileMode.Create))
                {
                    var encoder = new PngBitmapEncoder();
                    encoder.Frames.Add(BitmapFrame.Create(_lowerRenderTargetBitmap));
                    encoder.Save(fileStream);
                }

                Frames.Add(new FrameInfo
                {
                    Delay = Delay,
                    Path  = Path.Combine(RootFolder, fileName)
                });
            }

            GC.Collect();

            if (!_cancelled)
            {
                SeekNextFrame();
            }
        }
Example #4
0
        private void Search6_Egg()
        {
            var rng = new MersenneTwister(Seed.Value);
            int min = (int)Frame_min.Value;
            int max = (int)Frame_max.Value;

            if (AroundTarget.Checked)
            {
                min = (int)TargetFrame.Value - 100; max = (int)TargetFrame.Value + 100;
            }
            // Advance
            for (int i = 0; i < min; i++)
            {
                rng.Next();
            }
            // Prepare
            getsetting(rng);

            // The egg already have
            uint[] key    = { Key0.Value, Key1.Value };
            var    eggnow = RNGPool.GenerateAnEgg6(key);

            eggnow.hiddenpower = (byte)Pokemon.getHiddenPowerValue(eggnow.IVs);
            if (RNGPool.IsMainRNGEgg)
            {
                eggnow.PID = 0xFFFFFFFF;
            }
            eggnow.Status = "Current";
            Frames.Add(new Frame(eggnow, frame: -1));

            // Start
            for (int i = min; i <= max; i++, RNGPool.AddNext(rng))
            {
                var result = RNGPool.GenerateEgg6();
                if (!filter.CheckResult(result))
                {
                    continue;
                }
                Frames.Add(new Frame(result, frame: i, time: i - min));
                if (Frames.Count > 100000)
                {
                    return;
                }
            }
        }
Example #5
0
        public override void Read(string filename)
        {
            FileData f = new FileData(filename);

            f.Endian = Endianness.Big;
            f.seek(4);
            if (f.readUInt() != Magic)
            {
                return;
            }

            f.seek(0);
            uint bom = f.readUInt();

            if (bom == 0xFFFE0000)
            {
                Endian = Endianness.Little;
            }
            else if (bom == 0x0000FEFF)
            {
                Endian = Endianness.Big;
            }
            else
            {
                return;
            }
            f.Endian = Endian;

            f.seek(8);
            f.readInt(); // Always 0
            int frameCount = f.readInt();

            for (int i = 0; i < frameCount; i++)
            {
                pathFrame temp;
                temp.qx = f.readFloat();
                temp.qy = f.readFloat();
                temp.qz = f.readFloat();
                temp.qw = f.readFloat();
                temp.x  = f.readFloat();
                temp.y  = f.readFloat();
                temp.z  = f.readFloat();
                Frames.Add(temp);
            }
        }
Example #6
0
        private int findInsertionIndex(ReplayFrame frame)
        {
            var index = Frames.BinarySearch(frame, replay_frame_comparer);

            if (index < 0)
            {
                index = ~index;
            }
            else
            {
                while (index < Frames.Count && frame.Time == Frames[index].Time)
                {
                    ++index;
                }
            }

            return(index);
        }
Example #7
0
    public override void saveNextFrame()
    {
        var frame = Frames.Dequeue();

        var depthFramePath = Path.Combine(CurrentDirectory, CurrentFrame.ToString() + ".uint16");

        using (FileStream fs = new FileStream(depthFramePath, FileMode.CreateNew, FileAccess.Write)) {
            using (BinaryWriter bw = new BinaryWriter(fs)) {
                var res = frame.Resource;
                foreach (short value in res)
                {
                    bw.Write(value);
                }
            }
        }

        frame.Free();
    }
Example #8
0
        public void TryAdvance()
        {
            if (Frames.Count() <= 0)
            {
                return;
            }

            long currentTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

            if (_lastSwitch + AnimationDelay > currentTime)
            {
                _lastSwitch    = currentTime;
                _currentFrame += 1;
                _currentFrame %= Frames.Count();
                CurrentFrame   = Frames[_currentFrame];
                Advance        = true;
            }
        }
Example #9
0
        /// <summary>
        /// Opens the first trading interface.
        /// </summary>
        /// <param name="character">The character to open interface for.</param>
        private void OpenFirstInterface(Character character)
        {
            Character other = GetOther(character);

            Frames.SendInterface(character, 335, true);
            Frames.SendInventoryInterface(character, 336);
            Frames.SendTradeOptions(character);
            character.Session.SendData(new StringPacketComposer("Trading With: "
                                                                + other.PrettyName, 335, 15).Serialize());
            character.Session.SendData(new StringPacketComposer(
                                           other.PrettyName + " has " + other.Inventory.FreeSlots
                                           + " free inventory slots.", 335, 21).Serialize());
            character.Session.SendData(new StringPacketComposer("", 335, 36).Serialize());
            character.Session.SendData(new StringPacketComposer("", 335, 40).Serialize());
            character.Session.SendData(new StringPacketComposer("", 335, 41).Serialize());
            character.Session.SendData(new StringPacketComposer("", 335, 42).Serialize());
            Frames.SendHideTabs(character);
        }
Example #10
0
        public void Frames_Rolls_RollAddedToCurrentFrame()
        {
            //Arrange
            var frames = new Frames();

            //Act
            frames.Add(5);
            frames.Add(3);
            frames.Add(4);

            //Assert
            Assert.Equal(2, frames.CurrentFrame.Number);
            Assert.Equal(2, frames.Count);
            Assert.Equal(8, frames[0].Score);
            Assert.False(frames[0].IsOpen);
            Assert.Single(frames[1].Rolls);
            Assert.True(frames[1].CanRoll);
        }
Example #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Image"/> class
        /// by making a copy from another image.
        /// </summary>
        /// <param name="other">The other image, where the clone should be made from.</param>
        /// <exception cref="ArgumentNullException"><paramref name="other"/> is null
        /// (Nothing in Visual Basic).</exception>
        public Image(Image other) : base(other)
        {
            if (other == null)
            {
                throw new ArgumentNullException("Other image cannot be null.");
            }

            foreach (ImageFrame frame in other.Frames)
            {
                if (frame != null)
                {
                    Frames.Add(new ImageFrame(frame));
                }
            }

            DensityX = DefaultDensityX;
            DensityY = DefaultDensityY;
        }
Example #12
0
        public void RemoveFrame(int idx, bool deleteMorphs)
        {
            var frame  = Frames[idx];
            var parent = (odfFrame)frame.Parent;

            if (parent == null)
            {
                throw new Exception("The root frame can't be removed");
            }

            DeleteMeshesInSubframes(frame, deleteMorphs);
            DeleteReferringBones(frame);
            parent.RemoveChild(frame);
            Parser.UsedIDs.Remove((int)frame.Id);

            Frames.Clear();
            InitFrames(Parser.FrameSection.RootFrame);
        }
Example #13
0
        public void Init(Frame frame, bool frme)
        {
            BlockHeight = frame.Height;
            BlockWidth  = frame.Width;
            Frames.Clear();
            Frames.Add(frame);
            curFrame = 0;
            Size size = new Size(BlockWidth * MainForm.Zoom, BlockHeight * MainForm.Zoom);

            //Bricks = new Bitmap[3000];
            //BricksFade = new Bitmap[BlockWidth * MainForm.Zoom];
            Back = new Bitmap(BlockWidth * MainForm.Zoom, BlockHeight * MainForm.Zoom);
            Minimap.Init(BlockWidth, BlockHeight);
            PaintCurFrame();
            this.AutoScrollMinSize = size;
            this.Invalidate();
            started = true;
        }
Example #14
0
 private void logButton_Click(object sender, RoutedEventArgs e)
 {
     if (logButton.Content.ToString() == "Войти")
     {
         Frames.Navigate(new Resource.Pages.LoginPage(this));
     }
     else
     {
         connection.UpdateTimeInApp(timeInSessoin, accountName.Content.ToString());
         timerInApp.Stop();
         string imagePath = $"../../Resource/Pictures/Avatars/NoAvatar.png";
         Uri    imageUri  = new Uri(imagePath, UriKind.RelativeOrAbsolute);
         avatarImage.ImageSource = new BitmapImage(imageUri);
         accountName.Content     = "Гость";
         Frames.Navigate(new Resource.Pages.LoginPage(this));
         logButton.Content = "Войти";
     }
 }
Example #15
0
        public void SortFrames()
        {
            var rects = new List <Rect>();

            foreach (SpriteSheetFrame frameRect in Frames)
            {
                rects.Add(frameRect.BoundingRect);
            }

            Frames.Clear();

            SpriteSheetAndTextureFuncs.SortFramesLeftToRightTopToDown(rects);

            foreach (Rect rect in rects)
            {
                AddFrame(rect);
            }
        }
Example #16
0
        public AnimationRouteFrameSlider GetFrameSlider(TimeSpan currentStopperTime)
        {
            AnimationRouteFrameSlider slider = new AnimationRouteFrameSlider();
            //if(currentStopperTime < AnimationStartTime)
            //{
            //    if(Frames != null && Frames.Count > 0)
            //        slider.NextFrame = Frames[0];
            //    return slider;
            //}

            TimeSpan time    = currentStopperTime;// - AnimationStartTime;//lub odwrotnie
            bool     breaked = false;

            for (int i = 0; i < Frames.Count; i++)
            {
                var frame = Frames[i];
                if (time < frame.FrameTime)
                {
                    if (i - 1 >= 0)
                    {
                        slider.PreviousFrame = Frames[i - 1];
                    }
                    slider.CurrentFrame = frame;
                    if (i + 1 < Frames.Count)
                    {
                        slider.NextFrame = Frames[i + 1];
                    }

                    breaked = true;
                    break;
                }
                else
                {
                    time -= frame.FrameTime;
                }
            }

            if (!breaked)
            {
                slider.PreviousFrame = Frames.LastOrDefault();
            }

            return(slider);
        }
Example #17
0
        /// <summary>
        /// This method should be called immediately after InitializeComponent() in most cases, or whenever you modify the animation parameters.
        /// </summary>
        public void Render()
        {
            Dictionary <ObjectPropertyPair, AnimationTimeline> index = new Dictionary <ObjectPropertyPair, AnimationTimeline>();

            Frames.OrderBy <Frame, KeyTime>(delegate(Frame target)
            {
                return(target.KeyTime);
            });

            // The trick here is to turn time-dominant form into property-dominant form.
            foreach (Frame frame in Frames)
            {
                foreach (Setter setter in frame)
                {
                    ObjectPropertyPair pair = new ObjectPropertyPair(setter.TargetName, setter.Property);

                    AnimationTimeline animation;
                    if (!index.ContainsKey(pair))
                    {
                        animation = CreateAnimationFromType(setter.Property.PropertyType);
                        Storyboard.SetTargetName(animation, setter.TargetName);
                        Storyboard.SetTargetProperty(animation, new PropertyPath(setter.Property));
                        animation.Duration = this.Duration;

                        index.Add(pair, animation);
                    }
                    animation = index[pair];

                    ((IKeyFrameAnimation)animation).KeyFrames.Add(CreateKeyFrameFromType(setter.Property.PropertyType, setter.Value, frame.KeyTime));
                }
            }

            foreach (AnimationTimeline animation in index.Values)
            {
                if (LoopAnimation)
                {
                    // Finally, tie each animation closed by projecting its initial frame into the future so that interpolations will be smooth.
                    IKeyFrame firstFrame = (IKeyFrame)((IKeyFrameAnimation)animation).KeyFrames[0]; // Assume there will always be at least one frame.
                    ((IKeyFrameAnimation)animation).KeyFrames.Add(CreateKeyFrameFromType(firstFrame.Value.GetType(), firstFrame.Value.ToString(), KeyTime.FromTimeSpan(firstFrame.KeyTime.TimeSpan + this.Duration.TimeSpan)));
                }

                this.Children.Add(animation);
            }
        }
        public void Roll(int pins)
        {
            if (Frames.Count < Frame && Frame <= 10)
            {
                Frame newFrame;
                if (Frame == 10)
                {
                    newFrame = new TenthFrame();
                }
                else
                {
                    newFrame = new Frame();
                }

                if (Frames.Count != 0)
                {
                    Frames[Frames.Count - 1].NextFrame = newFrame;
                }
                newFrame.NewRoll(pins);
                if (pins == 10 && Frame != 10)
                {
                    newFrame.NewRoll(0);
                    Frame++;
                }
                Frames.Add(newFrame);
            }
            else
            {
                Frames[Frames.Count - 1].NewRoll(pins);
                if (Frame != 10)
                {
                    Frame++;
                }

                if (Frames.Count == 10)
                {
                    var totalPoints = Frames[Frames.Count - 1].FirstRoll + Frames[Frames.Count - 1].SecondRoll;
                    if (totalPoints < 10)
                    {
                        Frames[Frames.Count - 1].NewRoll(0);
                    }
                }
            }
        }
        public void ShouldSaveOriginalPoints()
        {
            var random = new Random();
            var frames = Enumerable.Range(0, 100)
                         .Select(index =>
            {
                byte[] bytes = new byte[128 * 72 * sizeof(float)];
                random.NextBytes(bytes);
                float[] frame = new float[128 * 72];
                Buffer.BlockCopy(bytes, 0, frame, 0, bytes.Length);
                return(new Frame(frame, 128, 72, (float)index / 30, (uint)index));
            })
                         .ToList();

            var fs = new Frames(frames.Select(frame => new Frame(frame.GetImageRowColsCopy(), frame.Rows, frame.Cols, frame.StartsAt, frame.SequenceNumber)), string.Empty, 30);

            var config = new DefaultFingerprintConfiguration
            {
                FrameNormalizationTransform = new NoFrameNormalization(),
                GaussianBlurConfiguration   = GaussianBlurConfiguration.None,
                OriginalPointSaveTransform  = frame =>
                {
                    byte[] original = new byte[frame.Length * sizeof(float)];
                    Buffer.BlockCopy(frame.ImageRowCols, 0, original, 0, original.Length);
                    return(original);
                }
            };

            var hashes = FingerprintService.Instance.CreateFingerprintsFromImageFrames(fs, config);

            Assert.AreEqual(hashes.Count, frames.Count);
            var originalPoints = hashes
                                 .OrderBy(_ => _.SequenceNumber)
                                 .Select(_ => _.OriginalPoint)
                                 .Select(point =>
            {
                float[] pt = new float[point.Length / 4];
                Buffer.BlockCopy(point, 0, pt, 0, point.Length);
                return(pt);
            })
                                 .ToList();

            CollectionAssert.AreEqual(frames.Select(_ => _.ImageRowCols).ToList(), originalPoints);
        }
Example #20
0
        private async void ExtractFrames()
        {
            SelectedFrame = VideoFrame.Default;
            Frames.Clear();

            TempManager.SetNewWorkingDir();

            SetBusy();

            List <VideoFrame> frameObjects = new List <VideoFrame>();

            await Task.Run(() =>
            {
                SetBusy("Extracting frames...");
                PullFrames(VideoFilePath, SelectedFrameRate, TempManager.WorkingDir.FullName);

                SetBusy("Generating thumbnails...");
                MakeThumbnails(VideoFilePath, SelectedFrameRate, TempManager.WorkingDir.FullName);

                SetBusy("Finishing up...");
                IEnumerable <FileInfo> allOutputFiles = TempManager.WorkingDir.EnumerateFiles("*.jpg");

                IEnumerable <FileInfo> framesOnly = allOutputFiles.Where(f => f.Name.StartsWith("thumb") == false);

                foreach (FileInfo frameFile in framesOnly)
                {
                    VideoFrame videoFrame = new VideoFrame()
                    {
                        FullPath      = frameFile.FullName,
                        ThumbnailPath = allOutputFiles.FirstOrDefault(f => f.Name == "thumb_" + frameFile.Name).FullName,
                        IsSelected    = false,
                        MD5           = HashHelper.GetMD5(frameFile.FullName),
                        SHA1          = HashHelper.GetSHA1(frameFile.FullName)
                    };

                    frameObjects.Add(videoFrame);
                }
            });

            Frames = new ObservableCollection <VideoFrame>(frameObjects);
            Frames[0].IsSelected = true;

            SetFree();
        }
Example #21
0
 public bool RemoveFrame(int frame)
 {
     if (frame > FrameCount)
     {
         return(false);
     }
     for (int i = frame; i <= FrameCount; i++)
     {
         if (i < FrameCount)
         {
             Frames[i] = Frames[i + 1];
         }
         else
         {
             Frames.Remove(FrameCount);
         }
     }
     return(true);
 }
Example #22
0
        private void OnFrameNavigated(FramePayload framePayload)
        {
            var isMainFrame = string.IsNullOrEmpty(framePayload.ParentId);
            var frame       = isMainFrame ? MainFrame : Frames[framePayload.Id];

            Contract.Assert(isMainFrame || frame != null, "We either navigate top level or have old version of the navigated frame");

            // Detach all child frames first.
            if (frame != null)
            {
                while (frame.ChildFrames.Count > 0)
                {
                    RemoveFramesRecursively(frame.ChildFrames[0]);
                }
            }

            // Update or create main frame.
            if (isMainFrame)
            {
                if (frame != null)
                {
                    // Update frame id to retain frame identity on cross-process navigation.
                    if (frame.Id != null)
                    {
                        Frames.Remove(frame.Id);
                    }
                    frame.Id = framePayload.Id;
                }
                else
                {
                    // Initial main frame navigation.
                    frame = new Frame(this, _client, null, framePayload.Id);
                }

                Frames[framePayload.Id] = frame;
                MainFrame = frame;
            }

            // Update frame payload.
            frame.Navigated(framePayload);

            FrameNavigated?.Invoke(this, new FrameEventArgs(frame));
        }
Example #23
0
        public static List <string> parseWordDocument(string path)
        {
            Application word = new Application();

            Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document();

            object fileName = path;

            // Define an object to pass to the API for missing parameters
            object missing = System.Type.Missing;

            doc = word.Documents.Open(ref fileName,
                                      ref missing, ref missing, ref missing, ref missing,
                                      ref missing, ref missing, ref missing, ref missing,
                                      ref missing, ref missing, ref missing, ref missing,
                                      ref missing, ref missing, ref missing);

            List <string> data = new List <string>();


            Frames frames = doc.Frames;

            for (int i = 1; i < frames.Count; i++)
            {
                data.Add(string.Format("{0} -  {1}", i, frames[i].Range.Text ?? "NULL"));
            }

            GC.Collect();
            GC.WaitForPendingFinalizers();

            //Release com objects to fully kill excel process from running in the background
            Marshal.ReleaseComObject(frames);

            //Close and release
            ((_Document)doc).Close();
            Marshal.ReleaseComObject(doc);

            //Quit and release
            ((_Application)word).Quit();
            Marshal.ReleaseComObject(word);

            return(data);
        }
Example #24
0
        public void EnsureHasFinalRange()
        {
            if (HasFinalRange)
            {
                return;
            }

            int maxSampleCount = Frames.Max(x => x.SampleCount);
            var dec            = new OpusDecoder(SampleRate, ChannelCount);
            var pcm            = new short[5760 * ChannelCount];

            foreach (OpusFrame frame in Frames)
            {
                dec.Decode(frame.Data, 0, frame.Data.Length, pcm, 0, maxSampleCount);
                frame.FinalRange = dec.FinalRange;
            }

            HasFinalRange = true;
        }
Example #25
0
        /// <summary>
        /// Loads the animation.
        /// </summary>
        /// <param name="animation">The animation.</param>
        /// <param name="quantizedImage">The quantized image.</param>
        private void LoadAnimation(Animation animation, QuantizedImage quantizedImage)
        {
            var TempImage         = animation[0];
            var TransparencyIndex = quantizedImage.TransparentIndex;

            Header           = new FileHeader();
            ScreenDescriptor = new LogicalScreenDescriptor(TempImage, TransparencyIndex, BitDepth);
            Frames.Add(new Frame(TempImage, quantizedImage, BitDepth, animation.Delay));
            if (animation.Count > 1)
            {
                AppExtension = new ApplicationExtension(animation.RepeatCount, animation.Count);
                for (int x = 1; x < animation.Count; ++x)
                {
                    quantizedImage = Quantizer.Quantize(animation[x], Quality);
                    TempImage      = animation[x];
                    Frames.Add(new Frame(TempImage, quantizedImage, BitDepth, animation.Delay));
                }
            }
        }
Example #26
0
        public override object[][] ExportData()
        {
            if (Frames == null)
            {
                return(null);
            }

            if (Frames.Length == 0)
            {
                return(null);
            }

            List <object[]> data = new List <object[]>();

            data.Add(Frames[0].Targets.Select(target => target.Whisker.WhiskerName).Cast <object>().ToArray());
            data.AddRange(Frames.Select(frame => frame.ExportData()));

            return(data.ToArray());
        }
Example #27
0
        private int findInsertionIndex(LegacyReplayFrame frame)
        {
            int index = Frames.BinarySearch(frame, replay_frame_comparer);

            if (index < 0)
            {
                index = ~index;
            }
            else
            {
                // Go to the first index which is actually bigger
                while (index < Frames.Count && frame.Time == Frames[index].Time)
                {
                    ++index;
                }
            }

            return(index);
        }
Example #28
0
        public void Play(int score, IGameCalculator gameCalculator, int currentFrameCounter, RollResults rollResult, Guid currentGameId)
        {
            Logger.Info("BowlingPlayer :: Play");

            _currentFrameCounter = currentFrameCounter;

            ValidateData(score, rollResult);

            try
            {
                if (rollResult == RollResults.Bonus)
                {
                    HandleBonusRoll(score, gameCalculator, currentGameId);
                    return;
                }

                if (ShouldCreateFrame())
                {
                    Frames.Add(new Frame(_currentFrameCounter));
                }

                CurrentFrame = Frames[_currentFrameCounter];

                if (HandleStrikeFrame(currentGameId, gameCalculator, score))
                {
                    return;
                }

                CurrentFrame.RollScore.Add(new RollScore(score));

                if (HandleSpareFrame(currentFrameCounter))
                {
                    return;
                }

                HandleFullFrame(currentGameId, gameCalculator, score);
            }
            catch (Exception e)
            {
                Logger.Error(e);
                throw e;
            }
        }
Example #29
0
        private void Search7_TimelineLeap1(int newstartframe, int targetframe, ModelStatus status, int totaltime)
        {
            // Prepare
            SFMT sfmt = new SFMT(Seed.Value);

            for (int i = 0; i < newstartframe; i++)
            {
                sfmt.Next();
            }
            getsetting(sfmt);
            int frame = newstartframe;
            int frameadvance, Currentframe;

            // Start
            for (int i = 0; i <= totaltime; i++)
            {
                Currentframe = frame;

                RNGPool.CopyStatus(status);

                var result = RNGPool.Generate7();

                byte Jumpflag = (byte)(status.fidget_cd == 1 ? 1 : 0);
                frameadvance = status.NextState();
                frame       += frameadvance;
                for (int j = 0; j < frameadvance; j++)
                {
                    RNGPool.AddNext(sfmt);
                }
                if (Currentframe <= targetframe && targetframe < frame)
                {
                    Frame.standard = i * 2;
                }

                if (!filter.CheckResult(result))
                {
                    continue;
                }

                Frames.Add(new Frame(result, frame: Currentframe, time: i * 2, blink: Jumpflag));
            }
        }
Example #30
0
        public override List <SceneAnimation> ExecuteEffect(EffectScript Script)
        {
            //Animations = new List<SceneAnimation>();
            //AnimationStack.Add(Animations);

            CurrentFrame = Frames.Last();
            CurrentFrame.UseFrame();

            if (!(Element == CreatureElement.EARTH && Opponent.NotEffectedByEarth.Evaluate()))
            {
                List <byte> Memory = Script.Script;
                for (int i = 0; i < Memory.Count; i++)
                {
                    OP_Decode[Memory[i] >> 4]((byte)(Memory[i] & 0x0F))();
                }
            }

            /*AnimationStack.Remove(Animations);
             *          List<SceneAnimation> Finished = Animations;
             *          if (AnimationStack.Count > 0) {
             *                  Animations = AnimationStack.Last();
             *          } else {
             *                  AnimationStack.Clear();
             *                  Animations = null;
             *          }*/

            Frames.Remove(CurrentFrame);
            List <SceneAnimation> Finished = Animations;

            if (Frames.Count > 0)
            {
                CurrentFrame = Frames.Last();
                CurrentFrame.UseFrame();
            }
            else
            {
                Frames.Clear();
                CurrentFrame = null;
            }

            return(Finished);
        }
Example #31
0
        public override void Read(string filename)
        {
            FileData f = new FileData(filename);

            byte[] magic      = f.read(0xC);;
            int    frameCount = f.readInt();

            for (int i = 0; i < frameCount; i++)
            {
                pathFrame temp;
                temp.qx = f.readFloat();
                temp.qy = f.readFloat();
                temp.qz = f.readFloat();
                temp.qw = f.readFloat();
                temp.x  = f.readFloat();
                temp.y  = f.readFloat();
                temp.z  = f.readFloat();
                Frames.Add(temp);
            }
        }
Example #32
0
        /// <summary>
        /// Initializes a new instance of the MainViewModel class.
        /// </summary>
        public MainViewModel()
        {
            if (IsInDesignMode)
            {
                // Code runs in Blend --> create design time data.
            }
            else
            {
                // testing showed that once the number of frames loading exceeded the processor count, performance started dropping
                int x = Environment.ProcessorCount;
                LoadRestrictor = new SemaphoreSlim(x, x);

                foreach (string img in Directory.EnumerateFiles(PATH_TO_IMAGES, "*", SearchOption.AllDirectories))
                {
                    Frame temp = new Frame(img);
                    temp.IsInViewChanged += Temp_IsInViewChanged;
                    Frames.Add(temp);
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of NoFrameWriterProvidedException.
 /// </summary>
 /// <param name="frame">The frame that did not support the write operation.</param>
 /// <param name="version">The ID3 v2 major version of the tag in which the frame was to be written.</param>
 /// <param name="message">The error message that explains the reason for the exception.</param>
 /// <param name="inner">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>
 public NoFrameWriterProvidedException(Frames.Frame frame, ID3v2MajorVersion version,string message, Exception inner)
     : base(message, inner)
 {
     this._frame=frame;
     this._version=version;
 }
Example #34
0
        public Cell(int aid, string CellData, int w, int h, Frames.MapFrame frame)
        {
            try
            {
                id = aid;
                Frame = frame;
                byte[] CellInfo = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                for (int i = CellData.Length - 1; i >= 0; i--)
                    CellInfo[i] = (byte)Program.Hash.IndexOf(CellData[i]);

                active = ((CellInfo[0] & 32) >> 5) != 0;
                if (!active)
                {
                    gID = 0;
                    return;
                }
                LoS = (CellInfo[0] & 1) != 0;
                grot = (CellInfo[1] & 48) >> 4;
                glvl = CellInfo[1] & 15;
                type = (CellInfo[2] & 56) >> 3;
                gID = ((CellInfo[0] & 24) << 6) + ((CellInfo[2] & 7) << 6) + CellInfo[3];
                ground = frame.getBitmap(gID, true);
                gslope = (CellInfo[4] & 60) >> 2;
                gflip = ((CellInfo[4] & 2) >> 1) != 0;
                o1ID = ((CellInfo[0] & 4) << 11) + ((CellInfo[4] & 1) << 12) + (CellInfo[5] << 6) + CellInfo[6];
                object1 = frame.getBitmap(o1ID, false);
                o1rot = (CellInfo[7] & 48) >> 4;
                o1flip = ((CellInfo[7] & 8) >> 3) != 0;
                o2flip = ((CellInfo[7] & 4) >> 2) != 0;
                o2interactive = Convert.ToBoolean((CellInfo[7] & 2) >> 1);
                o2ID = ((CellInfo[0] & 2) << 12) + ((CellInfo[7] & 1) << 12) + (CellInfo[8] << 6) + CellInfo[9];
                object2 = frame.getBitmap(o2ID, false);

                if (ground != null)
                {
                    if (gflip)
                        ground.RotateFlip(RotateFlipType.RotateNoneFlipX);

                    if (grot == 1)
                    {
                        ground.RotateFlip(RotateFlipType.RotateNoneFlipX);
                        gflip = true;
                        grot = 0;
                    }
                    else if (grot == 2)
                        ground.RotateFlip(RotateFlipType.Rotate180FlipNone);
                    else if (grot == 3)
                        ground.RotateFlip(RotateFlipType.Rotate180FlipX);
                }

                if (object1 != null)
                {
                    if (o1flip)
                        object1.RotateFlip(RotateFlipType.RotateNoneFlipX);

                    if (o1rot == 1)
                    {
                        object1.RotateFlip(RotateFlipType.RotateNoneFlipX);
                        o1flip = true;
                        o1rot = 0;
                    }
                    else if (o1rot == 2)
                        object1.RotateFlip(RotateFlipType.Rotate180FlipNone);
                    else if (o1rot == 3)
                        object1.RotateFlip(RotateFlipType.Rotate180FlipX);
                }

                if (object2 != null)
                {
                    if (o2flip)
                        object2.RotateFlip(RotateFlipType.RotateNoneFlipX);
                }

                pos = getPositionByCellID(id, glvl, w, h);
            }
            catch { }
        }
Example #35
0
 public Cell(int i,int w,int h, Frames.MapFrame frame)
 {
     id = i;
     Frame = frame;
     pos = getPositionByCellID(i,glvl,w,h);
 }
Example #36
0
 public LightsourceInfo(Frames.FrameLightsource lightTag)
 {
     this.Type = lightTag.LightType;
     //this.Direction = lightTag.Parameters[]
     this.Position = lightTag.Parameters.Get<Vector>(FrameLightsource.PointLightPosition);
     this.Spectra = lightTag.Parameters.Get<RgbSpectrum>(FrameLightsource.LightsourcePower).ToArray();
     this.MeshName = lightTag.Parameters.Get<string>(FrameLightsource.AreaLightGeometryName);
     this.ProfileName = lightTag.ProfileName;
     this.ImageName = lightTag.Parameters.Get<string>(FrameLightsource.InfiniteLightMapPath);
     this.Turbulence = lightTag.Parameters.Get(FrameLightsource.SkyLightTurbulence, 1.5f);
     this.Direction = lightTag.Parameters.Get(FrameLightsource.SkyLightSunDir, new Vector(0, 0, 1f));
     this.Gain = new float[3];
 }
Example #37
0
        static Dictionary<string, Frame> LoadFrames(string dir)
        {
            for (int i = 0; i < LoadedFrames.Count; i++)
            {
                if (LoadedFrames[i].dir == dir)
                    return LoadedFrames[i].m_Frames;
            }

            Frames frame = new Frames();
            string name = "";
            XDocument doc = XDocument.Load(dir);
            foreach (XElement animParts in doc.Descendants())
            {
                string s = animParts.Name.ToString();
                if (animParts.Name == "Frames" || animParts.Name == "Asset")
                {
                    foreach (XElement key in animParts.Descendants())
                    {
                        if (key.Name == "Key")
                        {
                            if (name != "")
                            {
                                throw new InvalidOperationException("Error: We have a name that's not been set yet");
                            }
                            name = key.Value;
                        }
                        else if (key.Name == "Value")
                        {
                            if (name == "")
                            {
                                throw new InvalidOperationException("Error: We have no name set yet");
                            }
                            Frame f = new Frame();
                            List<string> parts = key.Value.Split(' ').ToList<string>();
                            f.Position.X = float.Parse(parts[0]);
                            f.Position.Y = float.Parse(parts[1]);

                            f.Dimensions.X = float.Parse(parts[2]);
                            f.Dimensions.Y = float.Parse(parts[3]);

                            frame.m_Frames.Add(name, f);

                            name = "";
                        }
                    }
                }
            }
            frame.dir = dir;
            LoadedFrames.Add(frame);
            return frame.m_Frames;
        }
 public void setFirstFrame(Frames FirstFrame)
 {
     this.GameObj.GetComponent<AnimSpriteRenderer>().AnimFirstFrame = (int)FirstFrame + offset;
 }
Example #39
0
 void infoDownloader_Completed(object sender, DownloaderEventArgs e)
 {
     #region 通过XmlReader解析xml配置文件(无需额外dll,较慢)
     //WebClient infoDownloader = sender as WebClient;
     //infoDownloader.OpenReadCompleted -= wc_OpenReadCompleted;
     ////通过XmlReader解析配置文件
     //XmlReader info = XmlReader.Create(e.Result as Stream);
     //while (info.Read()) {
     //    if (info.IsStartElement("Sprite")) {
     //        info.MoveToAttribute("RealWidth"); info.ReadAttributeValue(); RealWidth = Convert.ToDouble(info.Value);
     //        info.MoveToAttribute("FullName"); info.ReadAttributeValue(); FullName = info.Value;
     //        info.MoveToAttribute("ATK"); info.ReadAttributeValue(); ATK = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("DEF"); info.ReadAttributeValue(); DEF = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("MAG"); info.ReadAttributeValue(); MAG = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("DEX"); info.ReadAttributeValue(); DEX = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("Speed"); info.ReadAttributeValue(); Speed = Convert.ToDouble(info.Value);
     //        info.MoveToAttribute("AttackType"); info.ReadAttributeValue(); AttackType = (AttackTypes)Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("GuardDistance"); info.ReadAttributeValue(); GuardDistance = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("SightDistance"); info.ReadAttributeValue(); SightDistance = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("AttackDistance"); info.ReadAttributeValue(); AttackDistance = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("CastingDistance"); info.ReadAttributeValue(); CastingDistance = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("LifeWidthMax"); info.ReadAttributeValue(); LifeWidthMax = Convert.ToDouble(info.Value);
     //        info.MoveToAttribute("LifeCenterY"); info.ReadAttributeValue(); LifeCenterY = Convert.ToDouble(info.Value);
     //        info.MoveToAttribute("CenterX"); info.ReadAttributeValue(); double centerX = Convert.ToDouble(info.Value);
     //        info.MoveToAttribute("CenterY"); info.ReadAttributeValue(); double centerY = Convert.ToDouble(info.Value);
     //        Center = new Point(centerX, centerY);
     //        info.MoveToAttribute("ModelCode"); info.ReadAttributeValue(); ModelCode = Convert.ToInt32(info.Value);
     //        frames = new Frames();
     //        info.MoveToAttribute("StandTotalFrame"); info.ReadAttributeValue(); frames.StandTotal = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("StandEffectFrame"); info.ReadAttributeValue(); frames.StandEffect = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("StandInterval"); info.ReadAttributeValue(); frames.StandInterval = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("RunTotalFrame"); info.ReadAttributeValue(); frames.RunTotal = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("RunEffectFrame"); info.ReadAttributeValue(); frames.RunEffect = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("RunInterval"); info.ReadAttributeValue(); frames.RunInterval = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("AttackTotalFrame"); info.ReadAttributeValue(); frames.AttackTotal = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("AttackEffectFrame"); info.ReadAttributeValue(); frames.AttackEffect = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("AttackInterval"); info.ReadAttributeValue(); frames.AttackInterval = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("InjureTotalFrame"); info.ReadAttributeValue(); frames.InjureTotal = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("InjureEffectFrame"); info.ReadAttributeValue(); frames.InjureEffect = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("InjureInterval"); info.ReadAttributeValue(); frames.InjureInterval = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("CastingTotalFrame"); info.ReadAttributeValue(); frames.CastingTotal = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("CastingEffectFrame"); info.ReadAttributeValue(); frames.CastingEffect = Convert.ToInt32(info.Value);
     //        info.MoveToAttribute("CastingInterval"); info.ReadAttributeValue(); frames.CastingInterval = Convert.ToInt32(info.Value);
     //    } else if (info.IsStartElement("Frames")) {
     //        while (info.Read()) {
     //            if (info.IsStartElement("Frame")) {
     //                info.MoveToAttribute("ID"); info.ReadAttributeValue(); string id = info.Value;
     //                info.MoveToAttribute("OffsetX"); info.ReadAttributeValue(); int offsetX = Convert.ToInt32(info.Value);
     //                info.MoveToAttribute("OffsetY"); info.ReadAttributeValue(); int offsetY = Convert.ToInt32(info.Value);
     //                frameOffset.Add(id, new Point2D() { X = offsetX, Y = offsetY });
     //            }
     //        }
     //    }
     //}
     #endregion
     #region 通过LinqToSql解析xml配置文件(需要100多K的dll支持,快)
     Downloader infoDownloader = sender as Downloader;
     infoDownloader.Completed -= infoDownloader_Completed;
     string key = string.Format("SpriteInfo{0}", infoDownloader.ResCode);
     if (e.Stream != null) { Global.AddResInfo(key, XElement.Load(e.Stream)); }
     //通过LINQ2XML解析配置文件
     XElement info = Global.ResInfos[key].DescendantsAndSelf("Sprite").Single();
     RealWidth = (double)info.Attribute("RealWidth");
     FullName = info.Attribute("FullName").Value;
     ATK = (int)info.Attribute("ATK");
     DEF = (int)info.Attribute("DEF");
     MAG = (int)info.Attribute("MAG");
     DEX = (int)info.Attribute("DEX");
     Speed = (double)info.Attribute("Speed");
     AttackType = (AttackTypes)(int)info.Attribute("AttackType");
     GuardDistance = (int)info.Attribute("GuardDistance");
     SightDistance = (int)info.Attribute("SightDistance");
     AttackDistance = (int)info.Attribute("AttackDistance");
     CastingDistance = (int)info.Attribute("CastingDistance");
     LifeWidthMax = (double)info.Attribute("LifeWidthMax");
     LifeCenterY = (double)info.Attribute("LifeCenterY");
     Center = new Point((double)info.Attribute("CenterX"), (double)info.Attribute("CenterY"));
     ModelCode = (int)info.Attribute("ModelCode");
     frames = new Frames() {
         StandTotal = (int)info.Attribute("StandTotalFrame"),
         StandEffect = (int)info.Attribute("StandEffectFrame"),
         StandInterval = (int)info.Attribute("StandInterval"),
         RunTotal = (int)info.Attribute("RunTotalFrame"),
         RunEffect = (int)info.Attribute("RunEffectFrame"),
         RunInterval = (int)info.Attribute("RunInterval"),
         AttackTotal = (int)info.Attribute("AttackTotalFrame"),
         AttackEffect = (int)info.Attribute("AttackEffectFrame"),
         AttackInterval = (int)info.Attribute("AttackInterval"),
         InjureTotal = (int)info.Attribute("InjureTotalFrame"),
         InjureEffect = (int)info.Attribute("InjureEffectFrame"),
         InjureInterval = (int)info.Attribute("InjureInterval"),
         CastingTotal = (int)info.Attribute("CastingTotalFrame"),
         CastingEffect = (int)info.Attribute("CastingEffectFrame"),
         CastingInterval = (int)info.Attribute("CastingInterval"),
     };
     //解析各帧偏移
     IEnumerable<XElement> iFrame = Global.ResInfos[key].Element("Frames").Elements();
     frameOffset.Clear();
     foreach (XElement element in iFrame) {
         frameOffset.Add(element.Attribute("ID").Value, new Point2D() {
             X = (int)element.Attribute("OffsetX"),
             Y = (int)element.Attribute("OffsetY"),
         });
     }
     #endregion
     if (State == States.Stand) { Stand(); }
     Coordinate = new Point(Coordinate.X + 0.000001, Coordinate.Y);
     Life = Life;
     HeartStart();
     if (ConfigReady != null) { ConfigReady(this, null); }
     //开始下载所需资源
     if (resList.ContainsKey(infoDownloader.ResCode)) {
         IsResReady = true;
     } else {
         #region 方案3
         //Downloader downloadQueue = new Downloader() { Index = index, ResCode = infoDownloader.ResCode };
         //EventHandler<DownloaderEventArgs> handler = null;
         //downloadQueue.Completed += handler = delegate {
         //    downloadQueue.Completed -= handler;
         //    if (downloadQueue.Index == index) { IsResReady = true; } //换装异步与呈现同步之间的协调
         //    loadedCodes.Add(downloadQueue.ResCode);
         //    //解析精灵图片资源地址表
         //    List<string> uris = new List<string>();
         //    int n = 0;
         //    for (int i = 0; i < (int)info.Attribute("StateTotal"); i++) {
         //        switch (i) {
         //            case 0: n = frames.StandTotal; break;
         //            case 1: n = frames.RunTotal; break;
         //            case 2: n = frames.AttackTotal; break;
         //            case 3: n = frames.InjureTotal; break;
         //            case 4: n = frames.CastingTotal; break;
         //        }
         //        for (int j = 0; j < (int)info.Attribute("DirectionTotal"); j++) {
         //            for (int k = 0; k <= n; k++) {
         //                uris.Add(Global.WebPath(string.Format("Sprite/{0}/{1}-{2}-{3}.png", Code, i, j, k)));
         //            }
         //        }
         //    }
         //};
         //downloadQueue.Download(string.Format("SpriteRes{0}", infoDownloader.ResCode), uris);
         #endregion
         #region 方案1、2
         IsResReady = false;
         Downloader resDownloader = new Downloader() { Index = index, ResCode = infoDownloader.ResCode };
         EventHandler<DownloaderEventArgs> handler = null;
         resDownloader.Completed += handler = (sender1, e1) => {
             resDownloader.Completed -= handler;
             if (resDownloader.Index == index) { IsResReady = true; }
             if (!resList.ContainsKey(resDownloader.ResCode)) {
                 resList.Add(resDownloader.ResCode, new StreamResourceInfo(e1.Stream, "application/binary"));
             }
         };
         resDownloader.Download(string.Format("Sprite{0}.xap", infoDownloader.ResCode));
         #endregion
     }
 }
Example #40
0
    //// Control validator only validates if the MPD has selected values and pd doesn't
    //protected void mpdValidate(object source, ServerValidateEventArgs args)
    //{
    //    DropDownList ddlMonoPdLeft = (DropDownList)fvSpecificFrame.FindControl("ddlMonoPdLeft");
    //    DropDownList ddlMonoPdRight = (DropDownList)fvSpecificFrame.FindControl("ddlMonoPdRight");
    //    DropDownList ddlPd = (DropDownList)fvSpecificFrame.FindControl("ddlPd");

    //    args.IsValid = ddlMonoPdLeft.SelectedIndex >= 1 && ddlMonoPdRight.SelectedIndex >= 1 && ddlPd.SelectedIndex < 0;

    //}

    //// Control validator only validates if the MPD has selected values and pd doesn't
    //protected void pdValidate(object source, ServerValidateEventArgs args)
    //{
    //    DropDownList ddlMonoPdLeft = (DropDownList)fvSpecificFrame.FindControl("ddlMonoPdLeft");
    //    DropDownList ddlMonoPdRight = (DropDownList)fvSpecificFrame.FindControl("ddlMonoPdRight");
    //    DropDownList ddlPd = (DropDownList)fvSpecificFrame.FindControl("ddlPd");

    //    args.IsValid = ddlMonoPdLeft.SelectedIndex < 0 && ddlMonoPdRight.SelectedIndex < 0 && ddlPd.SelectedIndex >= 1;

    //}

    //Add the merchandise to the cart
    protected void btnAddToCart_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            Session["token"] = "";
            Session["payerId"] = "";
            string glassesID = Request.QueryString["id"];
            string name = Frames.GetName(Convert.ToString(glassesID));
            string rightSph = ddlSphRight.SelectedItem.Text;
            string rightCyl = ddlCylRight.SelectedItem.Text;
            string rightAxis = ddlAxisRight.SelectedItem.Text;
            string rightPd = ddlMonoPdRight.SelectedItem.Text;
            string leftSph = ddlSphLeft.SelectedItem.Text;
            string leftCyl = ddlCylLeft.SelectedItem.Text;
            string leftAxis = ddlAxisLeft.SelectedItem.Text;
            string leftPd = ddlMonoPdLeft.SelectedItem.Text;
            string lensIndex = "";
            double price = Convert.ToDouble(Frames.GetPrice(glassesID));
            string image1 = Frames.GetImage1(glassesID);

            if (rb150Index.Checked == true) {
                lensIndex = rb150Index.Text;
            }

            else if (rb159Index.Checked == true)
            {
                lensIndex = rb159Index.Text;
                price += 29.95;
            }

            else if (rb161Index.Checked == true)
            {
                lensIndex = rb161Index.Text;
                price += 34.95;
            }

            else if (rb167Index.Checked == true)
            {
                lensIndex = rb167Index.Text;
                price += 69.95;
            }

            else if (rb150Trans.Checked == true)
            {
                lensIndex = rb150Trans.Text;
                price += 99.00;
            }

            else if (rb159Trans.Checked == true)
            {
                lensIndex = rb159Trans.Text;
                price += 109.00;
            }

            else if (rb160Trans.Checked == true)
            {
                lensIndex = rb160Trans.Text;
                price += 119.00;
            }

            Items frame = new Frames(glassesID, name, rightSph, rightCyl,
            rightAxis, rightPd, leftSph, leftCyl, leftAxis, leftPd, lensIndex, price,
            image1);

            if (Session["shoppingCart"] != null)
            {
                List<Items> shoppingList = (List<Items>)Session["shoppingCart"];
                shoppingList.Add(frame);
                Session["shoppingCart"] = shoppingList;
            }
            else
            {
                List<Items> shoppingList = new List<Items>();
                shoppingList.Add(frame);
                Session["shoppingCart"] = shoppingList;
            }
            Response.Redirect("~/View-Cart.aspx");
        }
    }
 public void setAnim(Frames FirstFrame)
 {
     runSingle = true;
     this.GameObj.GetComponent<AnimSpriteRenderer>().AnimTime = 0;
     this.GameObj.GetComponent<AnimSpriteRenderer>().AnimFirstFrame = ((int)FirstFrame + offset);
     this.GameObj.GetComponent<AnimSpriteRenderer>().AnimLoopMode = AnimSpriteRenderer.LoopMode.Once;
 }
 /// <param name="frameID">The ID of the unrecognized frame.</param>
 /// <summary>
 /// Initializes a new instance of NoFrameWriterProvidedException.
 /// </summary>
 /// <param name="frame">The frame that did not support the write operation.</param>
 /// <param name="version">The ID3 v2 major version of the tag in which the frame was to be written.</param>
 public NoFrameWriterProvidedException(Frames.Frame frame, ID3v2MajorVersion version)
 {
     this._frame=frame;
     this._version=version;
 }