• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MeltyPlayer / MeltyTool / 28220998723

26 Jun 2026 06:19AM UTC coverage: 40.975% (-0.1%) from 41.112%
28220998723

push

github

MeltyPlayer
Updated MarioArtist goldens.

7326 of 19830 branches covered (36.94%)

Branch coverage included in aggregate %.

30582 of 72686 relevant lines covered (42.07%)

59979.76 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.29
/FinModelUtility/Fin/Fin/src/util/progress/DelayedSplitPercentageProgress.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4

5
namespace fin.util.progress;
6

7
public sealed class DelayedSplitPercentageProgress(int capacity = 0)
6✔
8
    : IPercentageProgress {
9
  private bool isComplete_;
10
  private readonly List<PercentageProgress> progresses_ = new(capacity);
6✔
11
  private readonly List<bool> eachIsComplete_ = [];
6✔
12

13
  public PercentageProgress this[int index] => this.progresses_[index];
174✔
14

15
  private readonly object updateLock_ = new();
6✔
16

17
  public PercentageProgress Add() {
180✔
18
    lock (this.updateLock_) {
360✔
19
      var currentIndex = this.progresses_.Count;
180✔
20

21
      var progress = new PercentageProgress();
180✔
22
      this.progresses_.Add(progress);
180✔
23
      this.eachIsComplete_.Add(false);
180✔
24

25
      progress.OnProgressChanged += (_, _) => this.ReportProgressChanged_();
357✔
26
      progress.OnComplete += (_, _) => this.ReportComplete_(currentIndex);
357✔
27

28
      return progress;
180✔
29
    }
30
  }
180✔
31

32
  private void ReportProgressChanged_() {
350✔
33
    if (this.isComplete_) {
350!
34
      return;
×
35
    }
36

37
    lock (this.updateLock_) {
700✔
38
      var totalProgress = 0f;
350✔
39
      foreach (var (progress, isComplete) in this.progresses_.Zip(
41,100✔
40
                   this.eachIsComplete_)) {
20,375✔
41
        totalProgress += !isComplete ? progress.Progress : 1;
20,025✔
42
      }
20,025✔
43

44
      this.Progress = totalProgress / this.progresses_.Count;
350✔
45
      this.OnProgressChanged?.Invoke(this, this.Progress);
350!
46
    }
350✔
47
  }
350✔
48

49
  private void ReportComplete_(int index) {
177✔
50
    if (this.isComplete_) {
177!
51
      return;
×
52
    }
53

54
    lock (this.updateLock_) {
354✔
55
      this.eachIsComplete_[index] = true;
177✔
56
      this.isComplete_ = this.eachIsComplete_.All(b => b);
5,489✔
57
      if (!this.isComplete_) {
350✔
58
        this.ReportProgressChanged_();
173✔
59
      } else {
177✔
60
        this.OnComplete?.Invoke(this, EventArgs.Empty);
4!
61
      }
4✔
62
    }
177✔
63
  }
177✔
64

65
  public float Progress { get; private set; }
701✔
66
  public event EventHandler<float>? OnProgressChanged;
67
  public event EventHandler? OnComplete;
68
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc