Facepunch.Steamworks/Facepunch.Steamworks/Structs/LeaderboardUpdate.cs
2019-04-17 10:34:47 +01:00

22 lines
495 B
C#

using System.Linq;
namespace Steamworks.Data
{
public struct LeaderboardUpdate
{
public int Score;
public bool Changed;
public int NewGlobalRank;
public int OldGlobalRank;
public int RankChange => NewGlobalRank - OldGlobalRank;
internal static LeaderboardUpdate From( LeaderboardScoreUploaded_t e ) =>
new LeaderboardUpdate
{
Score = e.Score,
Changed = e.ScoreChanged == 1,
NewGlobalRank = e.GlobalRankNew,
OldGlobalRank = e.GlobalRankPrevious
};
}
}