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

MeltyPlayer / MeltyTool / 22551907903

01 Mar 2026 08:26PM UTC coverage: 41.595% (+0.06%) from 41.54%
22551907903

push

github

MeltyPlayer
Set up a little project for loading Mario Kart 3d tracks.

6988 of 18904 branches covered (36.97%)

Branch coverage included in aggregate %.

0 of 52 new or added lines in 4 files covered. (0.0%)

726 existing lines in 36 files now uncovered.

29926 of 69843 relevant lines covered (42.85%)

62490.11 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.Concurrent;
3
using System.Collections.Generic;
4
using System.Linq;
5

6
namespace fin.util.progress;
7

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

14
  public PercentageProgress this[int index] => this.progresses_[index];
165✔
15

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

18
  public PercentageProgress Add() {
171✔
19
    lock (this.updateLock_) {
342✔
20
      var currentIndex = this.progresses_.Count;
171✔
21

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

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

29
      return progress;
171✔
30
    }
31
  }
171✔
32

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

38
    lock (this.updateLock_) {
664✔
39
      var totalProgress = 0f;
332✔
40
      foreach (var (progress, isComplete) in this.progresses_.Zip(
36,996✔
41
                   this.eachIsComplete_)) {
18,332✔
42
        totalProgress += !isComplete ? progress.Progress : 1;
18,000✔
43
      }
18,000✔
44

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

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

55
    lock (this.updateLock_) {
336✔
56
      this.eachIsComplete_[index] = true;
168✔
57
      this.isComplete_ = this.eachIsComplete_.All(b => b);
4,958✔
58
      if (!this.isComplete_) {
332✔
59
        this.ReportProgressChanged_();
164✔
60
      } else {
168✔
61
        this.OnComplete?.Invoke(this, EventArgs.Empty);
4!
62
      }
4✔
63
    }
168✔
64
  }
168✔
65

66
  public float Progress { get; private set; }
665✔
67
  public event EventHandler<float>? OnProgressChanged;
68
  public event EventHandler? OnComplete;
69
}
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