parent
096d39609e
commit
8e9221bb5a
400 changed files with 3688 additions and 5969 deletions
|
|
@ -79,21 +79,13 @@ namespace Server.Factions
|
|||
{
|
||||
get
|
||||
{
|
||||
TimeSpan period;
|
||||
|
||||
switch (CurrentState)
|
||||
var period = CurrentState switch
|
||||
{
|
||||
default:
|
||||
case ElectionState.Pending:
|
||||
period = PendingPeriod;
|
||||
break;
|
||||
case ElectionState.Election:
|
||||
period = VotingPeriod;
|
||||
break;
|
||||
case ElectionState.Campaign:
|
||||
period = CampaignPeriod;
|
||||
break;
|
||||
}
|
||||
ElectionState.Pending => PendingPeriod,
|
||||
ElectionState.Election => VotingPeriod,
|
||||
ElectionState.Campaign => CampaignPeriod,
|
||||
_ => PendingPeriod
|
||||
};
|
||||
|
||||
TimeSpan until = LastStateTime + period - DateTime.UtcNow;
|
||||
|
||||
|
|
@ -104,21 +96,13 @@ namespace Server.Factions
|
|||
}
|
||||
set
|
||||
{
|
||||
TimeSpan period;
|
||||
|
||||
switch (CurrentState)
|
||||
var period = CurrentState switch
|
||||
{
|
||||
default:
|
||||
case ElectionState.Pending:
|
||||
period = PendingPeriod;
|
||||
break;
|
||||
case ElectionState.Election:
|
||||
period = VotingPeriod;
|
||||
break;
|
||||
case ElectionState.Campaign:
|
||||
period = CampaignPeriod;
|
||||
break;
|
||||
}
|
||||
ElectionState.Pending => PendingPeriod,
|
||||
ElectionState.Election => VotingPeriod,
|
||||
ElectionState.Campaign => CampaignPeriod,
|
||||
_ => PendingPeriod
|
||||
};
|
||||
|
||||
LastStateTime = DateTime.UtcNow - period + value;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue