mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-26 14:45:51 +03:00
22 lines
495 B
C#
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
|
|
};
|
|
}
|
|
} |