internal LeaderboardResult(IntPtr leaderboardResultPtr) { pImpl = new LeaderboardResultImpl(leaderboardResultPtr); LEADERBOARD_RESULT cResult = MarshalingHelpers.PtrToStructure <LEADERBOARD_RESULT>(leaderboardResultPtr); TotalRowCount = cResult.TotalRowCount; Columns = new List <LeaderboardColumn>(); if (cResult.ColumnsCount > 0) { IntPtr[] cColumns = new IntPtr[cResult.ColumnsCount]; Marshal.Copy(cResult.Columns, cColumns, 0, (int)cResult.ColumnsCount); for (uint i = 0; i < cResult.ColumnsCount; i++) { Columns.Add(new LeaderboardColumn(cColumns[i])); } } Rows = new List <LeaderboardRow>(); if (cResult.RowsCount > 0) { IntPtr[] cRows = new IntPtr[cResult.RowsCount]; Marshal.Copy(cResult.Rows, cRows, 0, (int)cResult.RowsCount); for (uint i = 0; i < cResult.RowsCount; i++) { Rows.Add(new LeaderboardRow(cRows[i])); } } }
// Used for mock services internal LeaderboardResult(IList <LeaderboardRow> rows, IList <LeaderboardColumn> cols, uint totalRowCount) { Rows = rows; Columns = cols; TotalRowCount = totalRowCount; pImpl = new MockLeaderboardResultImpl(); }