Esempio n. 1
0
        public string GetSliderData(Vector2 startPosition, int time, HitObjectType hitType,
                                    HitObjectSoundType hitsound, SliderCurveType sliderType, int repeat, float sliderVelocity, int numCurves, float timeSpan)
        {
            // Length will determine how long a slider will go on for
            int len = (int)(sliderVelocity * 100 * timeSpan);
            var hs  = new HitSlider(startPosition, time, hitType, hitsound, sliderType, repeat, sliderVelocity, numCurves, len);

            return(hs.SerializeForOsu());
        }
        public static char GetSliderChar(this SliderCurveType curveType)
        {
            switch (curveType)
            {
            case SliderCurveType.Linear:
                return('L');

            case SliderCurveType.Bezier:
                return('B');

            case SliderCurveType.PSpline:
                return('P');

            default:
                return('X');
            }
        }
Esempio n. 3
0
        public Slider(HitObjectType Type, Vector2 Position, double Time, Color Color, double[] VelocityParameters, String[] Parameters) : base(Type, Position, Time, Color)
        {
            this.Parameters = Parameters;
            PointsPosition  = new List <Vector2>();
            Velocity        = ToVelocity(VelocityParameters[0], VelocityParameters[1]);

            String[] SliderValues = Parameters[0].Split('|');
            CurveType = getCurveType(SliderValues[0]);

            for (var i = 0; i < SliderValues.Length - 1; i++)
            {
                String[] RawPoint = SliderValues[i + 1].Split(':');
                int      X        = Int32.Parse(RawPoint[0]) + 64;
                int      Y        = Int32.Parse(RawPoint[1]) + 56;
                PointsPosition.Add(new Vector2(X, Y));
            }

            Length = Math.Round(Double.Parse(Parameters[2]), 4);
        }
Esempio n. 4
0
        public HitSlider(Vector2 startPosition, int time, HitObjectType hitType, HitObjectSoundType hitsound,
                         SliderCurveType sliderType, int repeat, float velocity, int numCurves, int length)
        {
            this.startPosition = startPosition;
            this.Position      = startPosition;
            this.Time          = time;

            this.HitSound   = (int)hitsound;
            this.SliderType = sliderType;
            this.HitType    = (int)hitType;

            this.Repeat    = repeat;
            this.Velocity  = velocity;
            this.Length    = length;
            this.NumCurves = numCurves;



            ConstructSlider();
        }