EloDotNet 0.1.0

dotnet add package EloDotNet --version 0.1.0                
NuGet\Install-Package EloDotNet -Version 0.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EloDotNet" Version="0.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EloDotNet --version 0.1.0                
#r "nuget: EloDotNet, 0.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install EloDotNet as a Cake Addin
#addin nuget:?package=EloDotNet&version=0.1.0

// Install EloDotNet as a Cake Tool
#tool nuget:?package=EloDotNet&version=0.1.0                

EloDotNet

An ELO calculation framework for .NET

Getting Started

The easiest way to get started is to add the NuGet package to your project.

Usage

The package provides the following classes:

  • Player - represents a participant in the Elo ranking system. Typically uniquely identified with a Guid property.
  • Match - represents the participation of two Players in the system.
    • Describes the match results (who won/lost, or if the match was a draw).
    • A Match can only have one Result - whether the first or second player won, or if the match was a draw.
  • RankingSystem - encapsulates a collection of participating Players, and a list of Matches each player has participated in.

Note that for purposes of Elo calculation, all Players must be registered via RankingSystem.RegisterPlayer(), and all Matches must be recorded via RankingSystem.RecordMatch().

Extending

All default classes in EloDotNet implement their respective interfaces:

  • IPlayer<TId> - interface for a player entity with a unique identifier of type TId.
    • Note that TId must implement IEquatable<TId>.
  • IMatch<TPlayer, TIndex> - interface for a match entity between two TPlayer entities, and where each match can be ordered using the TIndex property.
    • Note that TPlayer must implement IPlayer<TId>.
    • TIndex must implement IComparable<TIndex>.
  • IRankingSystem<TPlayer, TMatch> - interface for a ranking system of TPlayer entities participating in TMatch matches.
    • Note that TPlayer must implement IPlayer<TId>.
    • Note that TMatch must implement IMatch<TPlayer, TIndex>.

Thus, it is possible to roll your own player, match and ranking system implementations.

  • RankingSystem also exposes a generic version with a default implementation, e.g. RankingSystem<IPlayer<TId>, IMatch<TId, TIndex>>.
    • This allows you to replace the player and match types while keeping the default Elo calculation algorithm, for instance.

Sample Code

Please check the test project EloDotNet.Tests to see sample snippets on how to use the default RankingSystem, as well as creating your custom IMatch and IPlayer implementations, and integrating them into a custom IRankingSystem implementation, with its own Elo calculation algorithm.

As more projects adapt EloDotNet, they'll be featured here for reference!

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 153 3/30/2024