public void ConvertToDto(ActivityDto dto, ActivityHolder activity) { ConvertToModelDto(dto, activity); dto.Date = activity.Date; dto.Id = activity.Id; dto.IsDone = activity.IsDone; }
public void ConvertToDto(ActivityDto dto, ActivityHolder activity, IEnumerable <TaskDto> tasks) { ConvertToDto(dto, activity); var task = tasks.Where(x => x.Id == dto.Id).SingleOrDefault(); if (task != null) { dto.Task = task; } }
public void ConvertFromDto(ActivityHolder activity, ActivityDto dto, IEnumerable <TaskHolder> tasks) { ConvertFromDto(activity, dto); var task = tasks.Where(x => x.Id == dto.Id).SingleOrDefault(); if (task != null) { activity.Task = task; } }
void UpdateRichPresence(ActivityHolder activityHolder) { ActivityHolder prev = activity; activity = activityHolder; if (!activity.Equals(prev) || !initialized) { Debug.Log("DiscordRichPresence: About to update presence"); activityManager.UpdateActivity(activity.GetActivity(), (result) => { Debug.Log(string.Format("DiscordRichPresence: Result is ({0})", result)); }); } }
private void UpdateHolders(ICollection <ActivityHolder> activities, IEnumerable <ActivityDto> dtos) { foreach (var dto in dtos) { var activityHolderToUpdate = activities.Where(x => x.Id == dto.Id).SingleOrDefault(); if (activityHolderToUpdate == null) { activityHolderToUpdate = new ActivityHolder(); activities.Add(activityHolderToUpdate); } if (activityHolderToUpdate.Task == null) { activityHolderToUpdate.Task = new TaskHolder(); } if (dto.Task != null) { _holdersConversionService.ConvertFromDto(activityHolderToUpdate.Task, dto.Task); } _holdersConversionService.ConvertFromDto(activityHolderToUpdate, dto); } }
void Awake() { Debug.Log("DiscordRichPresence: Plugin Awake"); lastUpdateTime = Time.time; activity = new IdleActivity(Utils.GetUnixTime(), GameScenes.LOADING); }
public void ConvertFromDto(ActivityHolder activity, ActivityDto dto) { ConvertFromModelDto(activity, dto); activity.Date = dto.Date; activity.IsDone = dto.IsDone; }