-
Notifications
You must be signed in to change notification settings - Fork 509
Expand file tree
/
Copy pathStatistic.cs
More file actions
31 lines (25 loc) · 1003 Bytes
/
Statistic.cs
File metadata and controls
31 lines (25 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
#nullable disable
namespace StyleCopTester
{
internal readonly struct Statistic
{
public Statistic(int numberOfNodes, int numberOfTokens, int numberOfTrivia)
{
this.NumberofNodes = numberOfNodes;
this.NumberOfTokens = numberOfTokens;
this.NumberOfTrivia = numberOfTrivia;
}
public int NumberofNodes { get; }
public int NumberOfTokens { get; }
public int NumberOfTrivia { get; }
public static Statistic operator +(Statistic statistic1, Statistic statistic2)
{
return new Statistic(
statistic1.NumberofNodes + statistic2.NumberofNodes,
statistic1.NumberOfTokens + statistic2.NumberOfTokens,
statistic1.NumberOfTrivia + statistic2.NumberOfTrivia);
}
}
}