compress datetime comparision, make default initial time consistent with other cores
This commit is contained in:
parent
77916cfa2c
commit
7314cf9192
|
@ -90,27 +90,12 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
|
||||||
|
|
||||||
[DisplayName("Initial Time")]
|
[DisplayName("Initial Time")]
|
||||||
[Description("Initial time of emulation.")]
|
[Description("Initial time of emulation.")]
|
||||||
[DefaultValue(typeof(DateTime), "2000-01-01")]
|
[DefaultValue(typeof(DateTime), "2010-01-01")]
|
||||||
[TypeConverter(typeof(BizDateTimeConverter))]
|
[TypeConverter(typeof(BizDateTimeConverter))]
|
||||||
public DateTime InitialTime
|
public DateTime InitialTime
|
||||||
{
|
{
|
||||||
get => _initaltime;
|
get => _initaltime;
|
||||||
set
|
set => _initaltime = value < minDate ? minDate : (value > maxDate ? maxDate : value);
|
||||||
{
|
|
||||||
if (DateTime.Compare(minDate, value) > 0)
|
|
||||||
{
|
|
||||||
_initaltime = minDate;
|
|
||||||
}
|
|
||||||
else if (DateTime.Compare(maxDate, value) < 0)
|
|
||||||
{
|
|
||||||
_initaltime = maxDate;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_initaltime = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DisplayName("Use Real Time")]
|
[DisplayName("Use Real Time")]
|
||||||
|
|
Loading…
Reference in New Issue