LapTimesDTO
This commit is contained in:
1 parent
361e76cc43
commit
7d083a6cf7
3 files changed
+24
-7
No files matched your search
@@ -21,6 +21,7 @@ public class LapService {
|
||||
string _mapName;
|
||||
PlayerData _player;
|
||||
PbDTO _pb;
|
||||
PbDTO _lr;
|
||||
|
||||
public Lap PB;
|
||||
|
||||
@@ -50,13 +51,14 @@ public class LapService {
|
||||
}
|
||||
}
|
||||
|
||||
PbDTO SetPb(string json) {
|
||||
PbDTO dto = JsonConvert.DeserializeObject<PbDTO>(json);
|
||||
_pb = dto;
|
||||
LapTimesDTO SetPb(string json) {
|
||||
LapTimesDTO dto = JsonConvert.DeserializeObject<LapTimesDTO>(json);
|
||||
_pb = dto.Pb;
|
||||
_lr = dto.LapRecord;
|
||||
|
||||
PB = new Lap {
|
||||
Map = _pb.Map,
|
||||
Sectors = dto.Sectors.Select((d, i) => new SectorTime { Sector = i + 1, Seconds = d }).ToList(),
|
||||
Sectors = _pb.Sectors.Select((d, i) => new SectorTime { Sector = i + 1, Seconds = d }).ToList(),
|
||||
};
|
||||
|
||||
return dto;
|
||||
|
||||
Reference in new issue
Block a user