Exemple #1
0
        public void ApplyPositionOffsets(IBeatmap beatmap)
        {
            var rng = new LegacyRandom(RNG_SEED);

            float? lastPosition  = null;
            double lastStartTime = 0;

            foreach (var obj in beatmap.HitObjects.OfType <CatchHitObject>())
            {
                obj.XOffset = 0;

                switch (obj)
                {
                case Fruit fruit:
                    if (HardRockOffsets)
                    {
                        applyHardRockOffset(fruit, ref lastPosition, ref lastStartTime, rng);
                    }
                    break;

                case BananaShower bananaShower:
                    foreach (var banana in bananaShower.NestedHitObjects.OfType <Banana>())
                    {
                        banana.XOffset = (float)(rng.NextDouble() * CatchPlayfield.WIDTH);
                        rng.Next();     // osu!stable retrieved a random banana type
                        rng.Next();     // osu!stable retrieved a random banana rotation
                        rng.Next();     // osu!stable retrieved a random banana colour
                    }

                    break;

                case JuiceStream juiceStream:
                    // Todo: BUG!! Stable used the last control point as the final position of the path, but it should use the computed path instead.
                    lastPosition = juiceStream.OriginalX + juiceStream.Path.ControlPoints[^ 1].Position.X;
Exemple #2
0
        private void queueDownloads(string[] sourceFilenames, int?limit = null)
        {
            try
            {
                // Matches osu-stable, in order to provide new users with roughly the same randomised selection of bundled beatmaps.
                var random = new LegacyRandom(DateTime.UtcNow.Year * 1000 + (DateTime.UtcNow.DayOfYear / 7));

                downloadableFilenames.AddRange(sourceFilenames.OrderBy(x => random.NextDouble()).Take(limit ?? int.MaxValue));
            }
            catch { }
        }