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

MeltyPlayer / MeltyTool / 19622977055

24 Nov 2025 04:05AM UTC coverage: 41.989% (+2.1%) from 39.89%
19622977055

push

github

MeltyPlayer
Switched float precision to fix broken tests.

6747 of 18131 branches covered (37.21%)

Branch coverage included in aggregate %.

28639 of 66144 relevant lines covered (43.3%)

65384.8 hits per line

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

86.67
/FinModelUtility/Fin/Fin/src/language/equations/fixedFunction/impl/FixedFunctionRegisters.cs
1
using System.Collections.Generic;
2
using System.Numerics;
3

4

5
namespace fin.language.equations.fixedFunction;
6

7
public sealed class FixedFunctionRegisters : IFixedFunctionRegisters {
8
  private readonly Dictionary<string, IColorRegister> colorRegistersMap_ =
64✔
9
      new();
64✔
10

11
  private readonly Dictionary<string, IScalarRegister> scalarRegistersMap_ =
64✔
12
      new();
64✔
13

14
  private readonly List<IColorRegister> colorRegisters_ = [];
64✔
15
  private readonly List<IScalarRegister> scalarRegisters_ = [];
64✔
16

17
  public IReadOnlyList<IColorRegister> ColorRegisters
18
    => this.colorRegisters_;
1,421✔
19

20
  public IReadOnlyList<IScalarRegister> ScalarRegisters
21
    => this.scalarRegisters_;
1,421✔
22

23
  public IColorRegister AmbientLightColorRegister { get; }
×
24
  public IScalarRegister AmbientLightAmountRegister { get; }
×
25

26
  public FixedFunctionRegisters() {
128✔
27
    this.AmbientLightColorRegister =
64✔
28
        this.GetOrCreateColorRegister("ambientLightColor",
64✔
29
                                      new ColorConstant(1));
64✔
30
    this.AmbientLightAmountRegister =
64✔
31
        this.GetOrCreateScalarRegister("ambientLightAmount",
64✔
32
                                       new ScalarConstant(.1f));
64✔
33
  }
64✔
34

35
  public IColorRegister GetOrCreateColorRegister(
36
      string name,
37
      IColorConstant defaultValue) {
927✔
38
    if (!this.colorRegistersMap_.TryGetValue(name, out var colorRegister)) {
1,276✔
39
      colorRegister = new ColorRegister(name, defaultValue);
349✔
40

41
      this.colorRegistersMap_[name] = colorRegister;
349✔
42
      this.colorRegisters_.Add(colorRegister);
349✔
43
    }
349✔
44

45
    return colorRegister;
927✔
46
  }
927✔
47

48
  public IScalarRegister GetOrCreateScalarRegister(
49
      string name,
50
      IScalarConstant defaultValue) {
626✔
51
    if (!this.scalarRegistersMap_.TryGetValue(name, out var scalarRegister)) {
807✔
52
      scalarRegister = new ScalarRegister(name, defaultValue);
181✔
53

54
      this.scalarRegistersMap_[name] = scalarRegister;
181✔
55
      this.scalarRegisters_.Add(scalarRegister);
181✔
56
    }
181✔
57

58
    return scalarRegister;
626✔
59
  }
626✔
60

61
  private class ColorRegister(string name, IColorConstant defaultValue)
349✔
62
      : BColorValue, IColorRegister {
63
    public string Name { get; } = name;
1,229✔
64

65
    // TODO: Consider switching this to a mutable color value and merging these fields
66
    public IColorConstant DefaultValue { get; set; } = defaultValue;
769✔
67
    public Vector3 Value { get; set; } = defaultValue.IntensityValue != null
349✔
68
        ? new Vector3(defaultValue.IntensityValue.Value)
349✔
69
        : new Vector3(defaultValue.RValue,
349✔
70
                      defaultValue.GValue,
349✔
71
                      defaultValue.BValue);
349✔
72

73
    public IColorValue ColorValue => this.DefaultValue;
420✔
74

75
    public override IScalarValue? Intensity => this.ColorValue.Intensity;
×
76
    public override IScalarValue R => this.ColorValue.R;
×
77
    public override IScalarValue G => this.ColorValue.G;
×
78
    public override IScalarValue B => this.ColorValue.B;
×
79

80
    public override string ToString() => $"{this.Name} : {this.ColorValue}";
×
81
  }
82

83
  private class ScalarRegister(string name, IScalarConstant defaultValue)
181✔
84
      : BScalarValue, IScalarRegister {
85
    public string Name { get; } = name;
498✔
86

87
    // TODO: Consider switching this to a mutable scalar value and merging these fields
88
    public IScalarConstant DefaultValue { get; set; } = defaultValue;
336✔
89
    public float Value { get; set; } = (float) defaultValue.Value;
181✔
90

91
    public IScalarValue ScalarValue => this.DefaultValue;
155✔
92

93
    public override string ToString() => $"{this.Name} : {this.ScalarValue}";
×
94
  }
95
}
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