示例#1
0
        public OsuPlayfield()
        {
            InternalChildren = new Drawable[]
            {
                playfieldBorder = new PlayfieldBorder {
                    RelativeSizeAxes = Axes.Both
                },
                spinnerProxies = new ProxyContainer {
                    RelativeSizeAxes = Axes.Both
                },
                followPoints = new FollowPointRenderer {
                    RelativeSizeAxes = Axes.Both
                },
                judgementLayer = new JudgementContainer <DrawableOsuJudgement> {
                    RelativeSizeAxes = Axes.Both
                },
                HitObjectContainer,
                judgementAboveHitObjectLayer = new Container {
                    RelativeSizeAxes = Axes.Both
                },
                approachCircles = new ProxyContainer {
                    RelativeSizeAxes = Axes.Both
                },
            };

            hitPolicy = new OrderedHitPolicy(HitObjectContainer);

            var hitWindows = new OsuHitWindows();

            foreach (var result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r)))
            {
                poolDictionary.Add(result, new DrawableJudgementPool(result, onJudgmentLoaded));
            }

            AddRangeInternal(poolDictionary.Values);

            NewResult += onNewResult;
        }
示例#2
0
        public OsuPlayfield()
        {
            InternalChildren = new Drawable[]
            {
                playfieldBorder = new PlayfieldBorder
                {
                    RelativeSizeAxes = Axes.Both,
                    Depth            = 3
                },
                spinnerProxies = new ProxyContainer
                {
                    RelativeSizeAxes = Axes.Both
                },
                followPoints = new FollowPointRenderer
                {
                    RelativeSizeAxes = Axes.Both,
                    Depth            = 2,
                },
                judgementLayer = new JudgementContainer <DrawableOsuJudgement>
                {
                    RelativeSizeAxes = Axes.Both,
                    Depth            = 1,
                },
                // Todo: This should not exist, but currently helps to reduce LOH allocations due to unbinding skin source events on judgement disposal
                // Todo: Remove when hitobjects are properly pooled
                new SkinProvidingContainer(null)
                {
                    Child = HitObjectContainer,
                },
                approachCircles = new ProxyContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    Depth            = -1,
                },
            };

            hitPolicy = new OrderedHitPolicy(HitObjectContainer);

            var hitWindows = new OsuHitWindows();

            foreach (var result in Enum.GetValues(typeof(HitResult)).OfType <HitResult>().Where(r => r > HitResult.None && hitWindows.IsHitResultAllowed(r)))
            {
                poolDictionary.Add(result, new DrawableJudgementPool(result));
            }

            AddRangeInternal(poolDictionary.Values);
        }