コード例 #1
0
ファイル: MainForm_Core.cs プロジェクト: Popognox/3DSRNGTool
        private void Search7_Egg()
        {
            var rng = new TinyMT(Status);
            int min = (int)Frame_min.Value;
            int max = (int)Frame_max.Value;

            // Advance
            for (int i = 0; i < min; i++)
            {
                rng.Next();
            }
            // Prepare
            getsetting(rng);
            // Start
            for (int i = min; i <= max; i++, RNGPool.AddNext(rng))
            {
                var result = RNGPool.GenerateEgg7() as EggResult;
                if (!filter.CheckResult(result))
                {
                    continue;
                }
                Frames.Add(new Frame(result, frame: i));
                if (Frames.Count > 100000)
                {
                    return;
                }
            }
        }
コード例 #2
0
ファイル: ManiaAutoGenerator.cs プロジェクト: Wieku/osu
        protected override void GenerateFrames()
        {
            if (Beatmap.HitObjects.Count == 0)
            {
                return;
            }

            var pointGroups = generateActionPoints().GroupBy(a => a.Time).OrderBy(g => g.First().Time);

            var actions = new List <ManiaAction>();

            foreach (var group in pointGroups)
            {
                foreach (var point in group)
                {
                    switch (point)
                    {
                    case HitPoint _:
                        actions.Add(columnActions[point.Column]);
                        break;

                    case ReleasePoint _:
                        actions.Remove(columnActions[point.Column]);
                        break;
                    }
                }

                Frames.Add(new ManiaReplayFrame(group.First().Time, actions.ToArray()));
            }
        }
コード例 #3
0
ファイル: Animation.cs プロジェクト: ldyeax/Sea-Pony-Dash
        public override void LoadXmlDoc(System.Xml.XmlDocument x)
        {
            foreach (XmlNode n in x.DocumentElement.ChildNodes)
            {
                string val = n.InnerText.Trim();
                switch (n.Name)
                {
                case "frames":
                    foreach (XmlNode frameNode in n.ChildNodes)
                    {
                        Frames.Add(new Frame(Helpers.NodeToDoc(frameNode)));
                    }
                    break;

                case "index":
                    Index = Convert.ToInt32(val);
                    break;

                case "start":
                    Start = Convert.ToInt32(val);
                    break;

                case "rate":
                    Rate = Convert.ToSingle(val);
                    break;

                case "name":
                    Name = val;
                    break;
                }
            }
        }
コード例 #4
0
        /// <summary>
        /// Javascript context was destroyed, cleanup everything.
        /// </summary>
        /// <param name="frameName"></param>
        private void OnWebViewJavascriptContextReleased(string frameName)
        {
            if (!WebView.IsMainFrame(frameName))
            {
                // ignore, its an iframe saying goodbye
                return;
            }

            lock (SyncRoot) {
                var mainFrame = Frames[FrameInfo.MainViewFrameName];

                Frames.Remove(mainFrame.Name);
                RecoverableFrames.Clear();
                foreach (var keyValuePair in Frames)
                {
                    RecoverableFrames[keyValuePair.Key] = new WeakReference <FrameInfo>(keyValuePair.Value);
                    UnregisterNativeObject(keyValuePair.Value.Component, keyValuePair.Value);
                }

                Frames.Clear();
                Frames.Add(mainFrame.Name, mainFrame);
                var previousComponentReady = mainFrame.IsComponentReadyToLoad;
                mainFrame.Reset();
                mainFrame.IsComponentReadyToLoad = previousComponentReady;
            }
        }
コード例 #5
0
        private void GetFiles(string folder)
        {
            if (Dispatcher?.Invoke(() => !IsLoaded) ?? false)
            {
                return;
            }

            foreach (var file in Directory.GetFiles(folder, "*.png"))
            {
                //Create an unique file name.
                string newName;
                do
                {
                    newName = Path.Combine(RootFolder, $"{Frames.Count} {DateTime.Now:yyMMdd-hhmmssffff}.png");
                }while (File.Exists(newName));

                File.Copy(file, newName);

                Frames.Add(new FrameInfo
                {
                    Delay = Delay,
                    Path  = newName
                });
            }

            ClearImportFolder(folder);

            Dispatcher?.Invoke(() => { DialogResult = true; });
        }
コード例 #6
0
 public void Load_Frames(EndianBinaryReader reader)
 {
     for (int i = 0; i < m_Frame_Count; i++)
     {
         Anim_Frame frame = new Anim_Frame(reader);
         Frames.Add(frame);
     }
 }
コード例 #7
0
 public SpriteSheetAnimationCycle(int from, int to)
     : this()
 {
     for (int i = from; i <= to; i++)
     {
         Frames.Add(i);
     }
 }
コード例 #8
0
ファイル: Animation.cs プロジェクト: svifylabs/dwarfcorp
 public Animation(NamedImageFrame frame) :
     this(GameState.Game.GraphicsDevice, new SpriteSheet(frame.AssetName), frame.AssetName, frame.SourceRect.Width, frame.SourceRect.Height, new List <Point>(), false, Color.White, 15.0f, frame.SourceRect.Width / 32.0f, frame.SourceRect.Height / 32.0f, false)
 {
     Frames.Add(new Point(frame.SourceRect.X / frame.SourceRect.Width, frame.SourceRect.Y / frame.SourceRect.Height));
     CreatePrimitives(GameState.Game.GraphicsDevice);
     Speeds          = new List <float>();
     SpeedMultiplier = 1.0f;
 }
コード例 #9
0
 public SpriteSheetAnimationCycle(params int[] frames)
     : this()
 {
     foreach (int frame in frames)
     {
         Frames.Add(frame);
     }
 }
コード例 #10
0
 public void LoadFromFolder(ContentManager contentManager, int framesCount, string path = "")
 {
     for (int i = 1; i <= framesCount; i++)
     {
         string imPath = path + "/" + i.ToString();
         Frames.Add(contentManager.Load <Texture2D>(imPath));
     }
 }
コード例 #11
0
ファイル: AnimationData.cs プロジェクト: rumkex/Calcifer
 public AnimationData(string name, float speed, IEnumerable <Pose> anim) : this(name, speed, new List <Pose>())
 {
     foreach (var frame in anim)
     {
         Frames.Add(frame);
     }
     BoneCount = Frames[0].BoneCount;
 }
コード例 #12
0
ファイル: GameController.cs プロジェクト: arsiarola/2dcsgo
 /// <summary>
 /// Gets the starting frame from Recorder, disables every recordable, and disables the Recorder, the Replayer and the Planning objects
 /// </summary>
 /// <remarks>
 /// Before start every Recordable that has been put to scene will execute their Awake methods which send a reference of that object to the GameController
 /// </remarks>
 private void Start()
 {
     Simulation.UpdateVisibility();
     GiveBomb();
     Frames.Add(Recorder.GetRecordableStates()); // get start frame. Not sure if necessary for the replay, but we do need to get the objects starting positions at least (then again these can be gained by other means)
     DisableRecordables();                       // disable recordables before they can execute their FixedUpdate or update methods
     Planning.LastFrame = Frames[Frames.Count - 1];
 }
コード例 #13
0
        private void Search6_Timeline()
        {
            if (!TTT.HasSeed)
            {
                Error("Please Calibrate Timeline");
                return;
            }

            RNGPool.timeline = TTT.gettimeline();
            int min = Math.Max((int)Frame_min.Value, RNGPool.timeline.Startingframe + 2);
            int max = (int)TimeSpan.Value * 60 + min;

            RNGPool.timeline.Maxframe = max;
            RNGPool.timeline.Generate(Method == 0); // Consider Stationary delay
            int listlength = RNGPool.timeline.TinyLength;

            // Prepare
            var rng = new MersenneTwister(Seed.Value);

            for (int i = 0; i < min; i++)
            {
                rng.Next();
            }
            getsetting(rng);

            for (int i = 0; i < listlength; i++)
            {
                var tinyframe = RNGPool.timeline.results[i];
                if (tinyframe.unhitable)
                {
                    continue;
                }
                if (tinyframe.framemax < min)
                {
                    continue;
                }
                for (int j = tinyframe.framemin + 2; j <= tinyframe.framemax; j += 2, RNGPool.AddNext(rng), RNGPool.AddNext(rng))
                {
                    while (j < min)
                    {
                        j += 2;
                    }
                    RNGPool.tinystatus = (TinyStatus)tinyframe.tinystate.DeepCopy();
                    RNGPool.tinystatus.Currentframe = j;
                    RNGResult result = RNGPool.Generate6();
                    if (!filter.CheckResult(result))
                    {
                        continue;
                    }
                    Frames.Add(new Frame(result, frame: j, time: j - min));
                    Frames.Last()._tinystate = new PRNGState(tinyframe.state);
                    if (Frames.Count > 100000)
                    {
                        return;
                    }
                }
            }
        }
コード例 #14
0
ファイル: ImportedEditor.cs プロジェクト: kkdevs/sb3u
        void InitFrames(ImportedFrame frame)
        {
            Frames.Add(frame);

            foreach (var child in frame)
            {
                InitFrames(child);
            }
        }
コード例 #15
0
        public void AddSpriteFrame(CCSpriteFrame frame)
        {
            var animFrame = new CCAnimationFrame(frame, 1.0f, null);

            Frames.Add(animFrame);

            // update duration
            TotalDelayUnits++;
        }
コード例 #16
0
ファイル: odfEditor.cs プロジェクト: kkdevs/sb3u
        void InitFrames(odfFrame frame)
        {
            Frames.Add(frame);

            for (int i = 0; i < frame.Count; i++)
            {
                InitFrames(frame[i]);
            }
        }
コード例 #17
0
 /// <summary>
 /// Construtor de uma animação
 /// </summary>
 /// <param name="name">Nome da animação que será utilizada como chave</param>
 /// <param name="frameSize">Tamanho do quadro</param>
 /// <param name="startFrame">Quadro inicial</param>
 /// <param name="framesCount">Quantidade de quadros</param>
 public Animation(List <Rectangle> frames, int startFrame, int framesCount)
 {
     this.framesCount = framesCount;
     // Armazena os quadros referêntes a esta animação
     for (int i = startFrame; i < startFrame + framesCount; i++)
     {
         Frames.Add(frames[i]);
     }
 }
コード例 #18
0
 public void AddFrame(ByteFrame frame)
 {
     Frames.Add(frame);
     if (!frame.MoreBytes)
     {
         CreateMedtronicMessage();
         EndOfMessage = true;
     }
 }
コード例 #19
0
 public void Read(BinaryReader reader)
 {
     for (int i = 0; i < FrameCount; i++)
     {
         var frame = new Frame();
         frame.Read(reader);
         Frames.Add(frame);
     }
 }
コード例 #20
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);
        }
コード例 #21
0
 public void Read(BinaryReader reader, bool BitFlipped = false)
 {
     for (int i = 0; i < FrameCount; i++)
     {
         var frame = new Frame();
         frame.Read(reader, BitFlipped);
         Frames.Add(frame);
     }
 }
コード例 #22
0
        public void AddFrame(Texture texture, IntRect subImageRect)
        {
            SubImage subImage;

            subImage.Texture      = texture;
            subImage.SubImageRect = subImageRect;

            Frames.Add(subImage);
        }
コード例 #23
0
 private void addFrame(double time, PippidonAction direction)
 {
     Frames.Add(new PippidonReplayFrame(direction)
     {
         Time = time
     });
     Frames.Add(new PippidonReplayFrame {
         Time = time + KEY_UP_DELAY
     });                                                                 //Release the keys as well
 }
コード例 #24
0
ファイル: Gesture.cs プロジェクト: jjjhanreyyy/GesturePak2V1
        public void AddSnapshot(Body body)
        {
            // create a Frame from the body
            var Frame = new Frame(body);

            // add it to the collection
            Frames.Add(Frame);
            // renumber the Frames (names them according to their position)
            this.Renumber();
        }
コード例 #25
0
ファイル: AeAnimator.cs プロジェクト: AlexMcGilvray/Aerolite
 public void AddFrames(params AeAnimationFrame[] frames)
 {
     if (frames != null)
     {
         for (int i = 0; i < frames.Length; i++)
         {
             Frames.Add(frames[i]);
         }
     }
 }
コード例 #26
0
ファイル: ExecutionState.cs プロジェクト: synfron/Staxe
        public ExecutionState(G groupState)
        {
            Frame <G> frame = new Frame <G> {
                GroupState = groupState
            };

            Frames.Add(frame);

            Sync(frame);
        }
コード例 #27
0
ファイル: EditArea.cs プロジェクト: capasha/EEOEditor
        public void createFrame(int n)
        {
            Frame frm = new Frame(BlockWidth, BlockHeight);

            Frames.Add(frm);
            //Frames.Add(frame);
            //Frames.Add(frame);
            //Frames[n].Reset();
            changeFrame(n);
        }
コード例 #28
0
        private void _debugManager_TargetStopped(object sender, Mono.Debugging.Client.TargetEventArgs e)
        {
            Frames.Clear();

            for (int i = 0; i < e.Backtrace.FrameCount; i++)
            {
                var frame = e.Backtrace.GetFrame(i);

                Frames.Add(new FrameViewModel(_debugManager, frame));
            }
        }
コード例 #29
0
ファイル: Game.cs プロジェクト: snagbg/golacorp-scorekeeper
 private Frame GetFrame(ushort FrameNumber)
 {
     if (!Frames.Any(x => x.FrameNumber == FrameNumber))
     {
         Frames.Add(new Frame()
         {
             FrameNumber = FrameNumber, FrameId = Guid.NewGuid()
         });
     }
     return(Frames.Single(x => x.FrameNumber == FrameNumber));
 }
コード例 #30
0
        public SpriteSheetFrame AddFrame(string name, int id, Rect frameRect)
        {
            SpriteSheetFrame frame = new SpriteSheetFrame(frameRect, this)
            {
                TagName = name, Id = id
            };

            Frames.Add(frame);

            return(frame);
        }