Beispiel #1
0
        private bool handleFlip(PositionRange selectionRange, CatchHitObject hitObject, bool flipOverOrigin)
        {
            switch (hitObject)
            {
            case BananaShower _:
                return(false);

            case JuiceStream juiceStream:
                juiceStream.OriginalX = getFlippedPosition(juiceStream.OriginalX);

                foreach (var point in juiceStream.Path.ControlPoints)
                {
                    point.Position *= new Vector2(-1, 1);
                }

                EditorBeatmap.Update(juiceStream);
                return(true);

            default:
                hitObject.OriginalX = getFlippedPosition(hitObject.OriginalX);
                return(true);
            }

            float getFlippedPosition(float original) => flipOverOrigin ? CatchPlayfield.WIDTH - original : selectionRange.GetFlippedPosition(original);
        }
Beispiel #2
0
        private bool handleFlip(PositionRange selectionRange, CatchHitObject hitObject)
        {
            switch (hitObject)
            {
            case BananaShower _:
                return(false);

            case JuiceStream juiceStream:
                juiceStream.OriginalX = selectionRange.GetFlippedPosition(juiceStream.OriginalX);

                foreach (var point in juiceStream.Path.ControlPoints)
                {
                    point.Position.Value *= new Vector2(-1, 1);
                }

                EditorBeatmap.Update(juiceStream);
                return(true);

            default:
                hitObject.OriginalX = selectionRange.GetFlippedPosition(hitObject.OriginalX);
                return(true);
            }
        }
Beispiel #3
0
 public static PositionRange Union(PositionRange a, PositionRange b) => new PositionRange(Math.Min(a.Min, b.Min), Math.Max(a.Max, b.Max));