I'm an idiot, they store encoded data for towers, we dont need a separate object unless we want to
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TOOHUCardAPI.Data.Models;
|
||||
|
||||
namespace TOOHUCardAPI.DTO.RankData
|
||||
{
|
||||
@@ -11,7 +13,25 @@ namespace TOOHUCardAPI.DTO.RankData
|
||||
public string Version { get; set; }
|
||||
public int Wave { get; set; }
|
||||
public long Damage { get; set; }
|
||||
// need cards here
|
||||
public List<RankCardDTO> Cards { get; set; }
|
||||
public Dictionary<string, string> Cards { get; set; }
|
||||
}
|
||||
|
||||
public static class RankEntryDTOExtensions
|
||||
{
|
||||
public static RankEntryDTO ToRankEntryDTO(this RankEntry rankEntry)
|
||||
{
|
||||
return new RankEntryDTO
|
||||
{
|
||||
RankType = ((char) rankEntry.RankType).ToString(),
|
||||
SteamId = rankEntry.User.SteamId,
|
||||
UserId = 0, // temporary
|
||||
Username = rankEntry.Username,
|
||||
Version = rankEntry.Version,
|
||||
Wave = rankEntry.Wave,
|
||||
Damage = rankEntry.Damage,
|
||||
Cards = rankEntry.TowersUsed.Select(tower => KeyValuePair.Create(tower.TowerKey, tower.EncodedData))
|
||||
.ToDictionary(kv => kv.Key, kv => kv.Value)
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user