EloDotNet 0.1.0
dotnet add package EloDotNet --version 0.1.0
NuGet\Install-Package EloDotNet -Version 0.1.0
<PackageReference Include="EloDotNet" Version="0.1.0" />
paket add EloDotNet --version 0.1.0
#r "nuget: EloDotNet, 0.1.0"
// 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 aGuid
property.Match
- represents the participation of twoPlayer
s in the system.- Describes the match results (who won/lost, or if the match was a draw).
- A
Match
can only have oneResult
- whether the first or second player won, or if the match was a draw.
RankingSystem
- encapsulates a collection of participatingPlayer
s, and a list ofMatch
es each player has participated in.
Note that for purposes of Elo calculation, all Player
s must be registered via RankingSystem.RegisterPlayer()
, and all Match
es 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 typeTId
.- Note that
TId
must implementIEquatable<TId>
.
- Note that
IMatch<TPlayer, TIndex>
- interface for a match entity between twoTPlayer
entities, and where each match can be ordered using theTIndex
property.- Note that
TPlayer
must implementIPlayer<TId>
. TIndex
must implementIComparable<TIndex>
.
- Note that
IRankingSystem<TPlayer, TMatch>
- interface for a ranking system ofTPlayer
entities participating inTMatch
matches.- Note that
TPlayer
must implementIPlayer<TId>
. - Note that
TMatch
must implementIMatch<TPlayer, TIndex>
.
- Note that
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 | Versions 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. |
-
.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 |