internal RpHitObjectDifficulty(BaseRpObject baseHitObject)
        {
            BaseHitObject = baseHitObject;
            //var circleRadius = baseHitObject.Scale * 64;
            var circleRadius = 1 * 64;

            var slider = BaseHitObject as RpHoldObject;

            if (slider != null)
            {
                MaxCombo += 2; // slider.Ticks.Count();
            }
            // We will scale everything by this factor, so we can assume a uniform CircleSize among beatmaps.
            scalingFactor = 52.0f / circleRadius;
            if (circleRadius < 30)
            {
                var smallCircleBonus = Math.Min(30.0f - circleRadius, 5.0f) / 50.0f;
                scalingFactor *= 1.0f + smallCircleBonus;
            }

            lazySliderLength = 0;
            //startPosition = baseHitObject.Position;
            startPosition = new Vector2();

            // Calculate approximation of lazy movement on the slider
            if (slider != null)
            {
                var sliderFollowCircleRadius = circleRadius * 3; // Not sure if this is correct, but here we do not need 100% exact values. This comes pretty darn close in my tests.

                // For simplifying this step we use actual osu! coordinates and simply scale the length, that we obtain by the ScalingFactor later
                var cursorPos = startPosition;

                Action <Vector2> addSliderVertex = delegate(Vector2 pos)
                {
                    var difference = pos - cursorPos;
                    var distance   = difference.Length;

                    // Did we move away too far?
                    if (distance > sliderFollowCircleRadius)
                    {
                        // Yep, we need to move the cursor
                        difference.Normalize();                    // Obtain the direction of difference. We do no longer need the actual difference
                        distance         -= sliderFollowCircleRadius;
                        cursorPos        += difference * distance; // We move the cursor just as far as needed to stay in the follow circle
                        lazySliderLength += distance;
                    }
                };

                // addSliderVertex(baseHitObject.EndPosition);
                addSliderVertex(new Vector2());

                lazySliderLength *= scalingFactor;
                endPosition       = cursorPos;
            }
            // We have a normal HitCircle or a spinner
            else
            {
                endPosition = startPosition;
            }
        }
        /// <summary>
        ///     建構
        /// </summary>
        public HitObjectRectanglePiece(BaseRpObject h)
        {
            HitObject = h;

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            Children = new Drawable[]
            {
                //背景,自帶masking
                _startBackgroundImagePicec = new ImagePicec("") //(RPSkinManager.GetStartObjectBackgroundByType(HitObject as BaseHitObject))
                {
                    Colour       = new Color4(100, 230, 17, 255),
                    Scale        = new Vector2(0.5f),
                    CornerRadius = DrawSize.X / 2,
                    Masking      = true
                },

                ////目前這層mask沒有用途
                _maskImagePicec = new ImagePicec("") //RPSkinManager.GetStartObjectMaskByType(HitObject as BaseHitObject))
                {
                    //Colour = osuObject.Colour,
                    Scale   = new Vector2(0.5f),
                    Masking = true
                },

                //外框使用
                _borderImagePicec = new ImagePicec(RpTexturePathManager.GetStartObjectImageNameByType(HitObject as BaseRpHitableObject))
                {
                    //Colour = new Color4(170, 58, 58,255),
                    Scale = new Vector2(0.5f)
                }
            };
        }
Example #3
0
        /// <summary>
        ///     ���\
        /// </summary>
        public HitObjectAnyShapePiece(BaseRpObject h)
        {
            HitObject = h;

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            Children = new Drawable[]
            {
                //�w�i�C����masking
                _startBackgroundImagePicec = new ImagePicec("") //(RPSkinManager.GetStartObjectBackgroundByType(HitObject as BaseHitObject))
                {
                    Colour       = RpTextureColorManager.GetKeyLayoutButtonShage(((BaseRpHitableObject)HitObject).Shape),
                    Scale        = new Vector2(0.5f),
                    CornerRadius = DrawSize.X / 2,
                    Masking      = true
                },

                ////�ڑO���wmask���L�p�r
                _maskImagePicec = new ImagePicec("") //RPSkinManager.GetStartObjectMaskByType(HitObject as BaseHitObject))
                {
                    //Colour = osuObject.Colour,
                    Scale   = new Vector2(0.5f),
                    Masking = true
                },

                //�O�y�g�p
                _borderImagePicec = new ImagePicec(RpTexturePathManager.GetStartObjectImageNameByType(HitObject as BaseRpHitableObject))
                {
                    Colour = RpTextureColorManager.GetKeyLayoutButtonShage(((BaseRpHitableObject)HitObject).Shape),
                    Scale  = new Vector2(0.5f)
                }
            };
        }
 /// <summary>
 /// </summary>
 /// <param name="hitObject"></param>
 public RpDrawHitObjectTemplate(BaseRpObject hitObject)
     : base(hitObject)
 {
     _hitObject = (BaseRpHitableObject)hitObject;
     InitialApproachHitPicec();
     InitialChild();
 }
 public static void BindingSingle(this List <BaseRpObject> ilstObjects, BaseRpObject single)
 {
     if (single is RpContainerLine rpContainerLine)
     {
         BindingRpContainerLine(ilstObjects, single);
     }
     //TODO ...
 }
Example #6
0
        /// <summary>
        ///     建構
        /// </summary>
        public BaseStillPiece(BaseRpObject h)
        {
            HitObject = h;

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;


            Children = new Drawable[]
            {
            };
        }
Example #7
0
        public HitExplosion(RpJudgement judgement, BaseRpObject h = null)
        {
            if (h is BaseRpHitableObject)
            {
                this.judgement = judgement;
                AutoSizeAxes   = Axes.Both;
                Origin         = Anchor.Centre;

                Direction = FillDirection.Vertical;
                Spacing   = new Vector2(0, 2);
                //Position = (h?.Position ?? Vector2.Zero) + judgement.PositionOffset;

                if (judgement.HitExplosionPosition.Count > 0)
                {
                    Position = judgement.HitExplosionPosition[0];
                }

                //根據物件去顯示成績
                switch (judgement.Score)
                {
                case RpScoreResult.Sad:
                    _hitEffect = new SadHitEffectTemplate();
                    break;

                case RpScoreResult.Safe:
                    _hitEffect = new SafeHitEffectTemplate();
                    break;

                case RpScoreResult.Fine:
                    _hitEffect = new FineHitEffectTemplate();
                    break;

                case RpScoreResult.Cool:
                    _hitEffect = new CoolHitEffectTemplate();
                    break;

                case RpScoreResult.Slider:
                    _hitEffect = new SlideHitEffectTemplate();
                    break;
                }

                //
                //_hitEffect = new FineHitEffectTemplate();
                //Position = PositionManager.GetPosition(h);

                //把物件增加上去
                Children = new Drawable[]
                {
                    _hitEffect
                };
            }
        }
Example #8
0
        public RpDrawBaseObjectTemplate(BaseRpObject hitObject)
        {
            _hitObject = hitObject;

            LoadEffect = new LoadEffect(_hitObject);

            PathPrecentageCounter = new PathPrecentageCounter(hitObject);

            Position = hitObject.Position;

            //裝基本物件用
            StartObjectContainer = new BaseComponent();

            InitialStartObjectEffect();
        }
Example #9
0
        /// <summary>
        /// get drawable by it's HitObject
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="field"></param>
        /// <param name="containerGroupObject"></param>
        /// <returns></returns>
        public static T GeDrawableByRpObject <T>(this IHasGameField field, BaseRpObject containerGroupObject) where T : DrawableBaseRpObject
        {
            foreach (var container in field.ListDrawableObject)
            {
                if (container.HitObject == containerGroupObject)
                {
                    if (container is T matchTypeDrawableObject)
                    {
                        return(matchTypeDrawableObject);
                    }
                }
            }

            return(null);
        }
Example #10
0
        /// <summary>
        ///     建構
        /// </summary>
        public LoadEffect(BaseRpObject h)
        {
            HitObject = h;

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            Children = new Drawable[]
            {
                _effectPicec = new ImagePicec(RpTexturePathManager.GetRPLoadEffect())
                {
                    Scale = new Vector2(1, 1),
                    Alpha = 0
                }
            };
        }
Example #11
0
        public Pointer(BaseRpObject baseRpObject)
        {
            this.baseRpObject = baseRpObject;

            //TIME_FADEIN = _baseRPObject.FadeInTime;
            //TIME_PREEMPT = _baseRPObject.PreemptTime;
            //TIME_FADEOUT = _baseRPObject.FadeOutTime;

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            AutoSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                approachCircle = new Sprite()
            };
        }
Example #12
0
        public Pointer(BaseRpObject baseRPObject)
        {
            _baseRPObject = baseRPObject;

            TIME_FADEIN  = _baseRPObject.TIME_FADEIN;
            TIME_PREEMPT = _baseRPObject.TIME_PREEMPT;
            TIME_FADEOUT = _baseRPObject.TIME_FADEOUT;

            Anchor = Anchor.Centre;
            Origin = Anchor.Centre;

            AutoSizeAxes = Axes.Both;

            Children = new Drawable[]
            {
                approachCircle = new Sprite()
            };
        }
Example #13
0
        /// <summary>
        /// </summary>
        /// <param name="hitObject"></param>
        public DrawableRpContainerLineGroup(BaseRpObject hitObject)
            : base(hitObject)
        {
            HitObject = (RpContainerLineGroup)hitObject;


            Template = new ContainerTemplate(HitObject)
            {
                Position = new Vector2(0, 0),
                Alpha    = 1
            };

            Children = new Drawable[]
            {
                Template
            };

            //may not be so correct
            //Size = _rpDetectPress.DrawSize;
            Scale = new Vector2(HitObject.Scale);
        }
 public DrawableBaseContainableObject(BaseRpObject hitObject) : base(hitObject)
 {
 }
Example #15
0
 /// <summary>
 /// </summary>
 /// <param name="hitObject"></param>
 public DrawableRpContainerLineGroup(BaseRpObject hitObject)
     : base(hitObject)
 {
     //Position = (HitObject as RpContainerLineGroup).Position;
 }
Example #16
0
 public PathPrecentageCounter(BaseRpObject baseHitObject)
 {
     _baseHitObject = baseHitObject;
 }
 public static void BindingRpContainerLine(this List <BaseRpObject> ilstObjects, BaseRpObject single)
 {
 }
Example #18
0
 public BaseStillHold(BaseRpObject h)
     : base(h)
 {
 }
Example #19
0
 /// <summary>
 /// </summary>
 /// <param name="hitObject"></param>
 public DrawableRpContainerLine(BaseRpObject hitObject)
     : base(hitObject)
 {
 }
Example #20
0
 public BaseStillSlide(BaseRpObject h)
     : base(h)
 {
 }