You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
935 B
32 lines
935 B
|
4 years ago
|
namespace ooya.ga_api;
|
||
|
|
|
||
|
|
public static class Mapper
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Для передачи в сторону пользователя
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="pGame"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public static GameDto ToGameDto(Game pGame)
|
||
|
|
{
|
||
|
|
GameDto pGameDto = new GameDto();
|
||
|
|
pGameDto.Guid = pGame.Guid;
|
||
|
|
pGameDto.Date = pGame.Date;
|
||
|
|
pGameDto.Score = pGame.Score;
|
||
|
|
pGameDto.Witches = pGame.Witches.Select(p => ToWitchDto(p));
|
||
|
|
return pGameDto;
|
||
|
|
}
|
||
|
|
/// <summary>
|
||
|
|
/// Для передачи в сторону пользователя
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="pWitch"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public static WitchDto ToWitchDto(Witch pWitch)
|
||
|
|
{
|
||
|
|
WitchDto pWitchDto = new WitchDto();
|
||
|
|
pWitchDto.Guid = pWitch.Guid;
|
||
|
|
pWitchDto.Position = pWitch.Position;
|
||
|
|
return pWitchDto;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|