Skip to main content

OpenTD reference 2026 R1

Class CompareData

Last update: 09.03.2026

Namespace: OpenTD.Results.Dataset
Assembly: OpenTD.Results.dll

public abstract class CompareData : ICompareData

Inheritance

object ← CompareData

Derived

PercentDifferenceCompareData

Implements

ICompareData

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

CompareData(IComparerInput, IComparerOutput)

public CompareData(IComparerInput comparerInput, IComparerOutput comparerOutput)

Parameters

comparerInput IComparerInput

comparerOutput IComparerOutput

Properties

ComparerInput

The Comparer will send data from the datasets through this member.

public IComparerInput ComparerInput { get; set; }

Property Value

IComparerInput

ComparerOutput

Send output from the comparison to the Comparer through this member.

public IComparerOutput ComparerOutput { get; set; }

Property Value

IComparerOutput

Methods

Compare(string, DataSubtype, IEnumerable<string>, IEnumerable<long>, IEnumerable<long>, bool)

This method implements the comparison algorithm.

public abstract void Compare(string name, DataSubtype subtype, IEnumerable<string> commonNames, IEnumerable<long> commonIndicesA, IEnumerable<long> commonIndicesB, bool msgOnSuccess = true)

Parameters

name string

This is a descriptive name for the data being compared. Use it in ComparerOutput messages.

subtype DataSubtype

This is the type of data (T, TL, etc.) to compare.

commonNames IEnumerable<string>

This is a list of Sinda names (MAIN.1, WALL.100, etc.) of entities that hold data of subtype and are common to both datasets. For example, if subtype is PL, then commonNames would be names of lumps that are common between the datasets. The comparison should be performed over all of the items in this list.

commonIndicesA IEnumerable<long>

These are the internal indices to the commonNames list for Dataset A.

commonIndicesB IEnumerable<long>

These are the internal indices to the commonNames list for Dataset B.

msgOnSuccess bool

If true, use ComparerOutput to write a message if this comparison is successful.

Connect with Ansys