public static TimeSpan GetTimeLeft(this Battle battle, int currentDay) { return(TimeHelper.CalculateTimeLeft( startDay: battle.StartDay, currentDay: currentDay, eventInDayLength: 1, startDateTime: battle.StartTime, currentDateTime: DateTime.Now)); }
private void initTime(Entities.Battle battle) { var timeLeft = TimeHelper.CalculateTimeLeft(battle.StartDay, GameHelper.CurrentDay, 1, battle.StartTime); if (timeLeft.TotalSeconds > 0) { TimeLeft = string.Format("{0:00}:{1:00}:{2:00}", Math.Floor(timeLeft.TotalHours), timeLeft.Minutes, timeLeft.Seconds); WaitingForResolve = false; } else { TimeLeft = "00:00:00"; WaitingForResolve = true; } }
public static TimeSpan GetTimeLeft(this CongressVoting voting, int currentDay) { return(TimeHelper.CalculateTimeLeft(voting.StartDay, currentDay, 1, voting.StartTime, DateTime.Now)); }