Ejemplo n.º 1
0
 public void Add(SentakkiLanedHitObject hitObject)
 {
     hitObject.LaneBindable.ValueChanged  += onLaneChanged;
     hitObject.BreakBindable.ValueChanged += onBreakChanged;
     HitObjects.AddInPlace(hitObject, Comparer <SentakkiLanedHitObject> .Create((lhs, rhs) => lhs.Lane.CompareTo(rhs.Lane)));
     UpdateLine();
 }
Ejemplo n.º 2
0
 public void Remove(SentakkiLanedHitObject hitObject)
 {
     hitObject.LaneBindable.ValueChanged  -= onLaneChanged;
     hitObject.BreakBindable.ValueChanged -= onBreakChanged;
     HitObjects.Remove(hitObject);
     UpdateLine();
 }
Ejemplo n.º 3
0
 public DrawableSentakkiLanedHitObject(SentakkiLanedHitObject hitObject)
     : base(hitObject)
 {
     AddRangeInternal(new Drawable[] {
         scorePaddingObjects = new Container <DrawableScorePaddingObject>()
     });
 }
Ejemplo n.º 4
0
        public void AddHitObject(SentakkiLanedHitObject hitObject)
        {
            var startTimeBindable = hitObject.StartTimeBindable.GetBoundCopy();

            startTimeBindable.ValueChanged += v => onStartTimeChanged(v, hitObject);
            startTimeMap[hitObject]         = startTimeBindable;

            addHitObjectToEntry(hitObject.StartTime, hitObject);
        }
Ejemplo n.º 5
0
        private int getDelta(SentakkiLanedHitObject a, SentakkiLanedHitObject b)
        {
            var delta = b.Lane - a.Lane;

            if (delta > 4)
            {
                delta -= 8;
            }
            return(delta);
        }
Ejemplo n.º 6
0
        private void addHitObjectToEntry(double entryTime, SentakkiLanedHitObject hitObject)
        {
            // Create new line entry for this entryTime if none exists
            if (!lineEntries.ContainsKey(entryTime))
            {
                var newEntry = new LineLifetimeEntry(animationDuration, drawableRuleset, entryTime);
                lineEntries[entryTime] = newEntry;
                lifetimeManager.AddEntry(newEntry);

                // We want to listen in on line changes in case we need to swap out colours/drawables
                newEntry.OnLineUpdated += onEntryUpdated;
            }
            lineEntries[entryTime].Add(hitObject);
        }
Ejemplo n.º 7
0
        private void removeHitObjectFromEntry(double entryTime, SentakkiLanedHitObject hitObject)
        {
            // Safety check to ensure the a line entry actually exists
            if (lineEntries.TryGetValue(entryTime, out var line))
            {
                line.Remove(hitObject);

                // Remove this entry completely if there aren't any hitObjects using it
                if (!line.HitObjects.Any())
                {
                    lifetimeManager.RemoveEntry(lineEntries[entryTime]);
                    lineEntries.Remove(entryTime);
                }
            }
        }
Ejemplo n.º 8
0
 public void Apply(SentakkiLanedHitObject lanedHitObject)
 {
     Position = SentakkiExtensions.GetPositionAlongLane(SentakkiPlayfield.INTERSECTDISTANCE, lanedHitObject.Lane);
     Colour   = lanedHitObject.NoteColour;
 }
Ejemplo n.º 9
0
 private void onStartTimeChanged(ValueChangedEvent <double> valueChangedEvent, SentakkiLanedHitObject hitObject)
 {
     removeHitObjectFromEntry(valueChangedEvent.OldValue, hitObject);
     addHitObjectToEntry(valueChangedEvent.NewValue, hitObject);
 }
Ejemplo n.º 10
0
 public void RemoveHitObject(SentakkiLanedHitObject hitObject)
 {
     startTimeMap.Remove(hitObject);
     removeHitObjectFromEntry(hitObject.StartTime, hitObject);
 }