private string GetStatus(WarStatus status) { string str = ""; switch (status) { case WarStatus.InProgress: str = "In Progress"; break; case WarStatus.Win: str = "Winning / Won"; break; case WarStatus.Lose: str = "Losing / Lost"; break; case WarStatus.Draw: str = "Draw"; break; case WarStatus.Pending: str = "Status Pending"; break; } return(str); }
private string GetStatus( WarStatus status ) { string str = ""; switch( status ) { case WarStatus.InProgress: str = "In Progress"; break; case WarStatus.Win: str = "Winning / Won"; break; case WarStatus.Lose: str = "Losing / Lost"; break; case WarStatus.Draw: str = "Draw"; break; case WarStatus.Pending: str = "Status Pending"; break; } return str; }
public void CheckExpiredWars() { for (int i = 0; i < AcceptedWars.Count; i++) { WarDeclaration w = AcceptedWars[i]; Guild g = w.Opponent; WarStatus status = w.Status; if (status != WarStatus.InProgress) { AllianceInfo myAlliance = Alliance; bool inAlliance = (myAlliance != null && myAlliance.IsMember(this)); AllianceInfo otherAlliance = ((g != null) ? g.Alliance : null); bool otherInAlliance = (otherAlliance != null && otherAlliance.IsMember(this)); if (inAlliance) { myAlliance.AllianceMessage( 1070739 + (int)status, (g == null) ? "a deleted opponent" : (otherInAlliance ? otherAlliance.Name : g.Name)); myAlliance.InvalidateMemberProperties(); } else { GuildMessage( 1070739 + (int)status, (g == null) ? "a deleted opponent" : (otherInAlliance ? otherAlliance.Name : g.Name)); InvalidateMemberProperties(); } AcceptedWars.Remove(w); if (g != null) { if (status != WarStatus.Draw) { status = (WarStatus)((int)status + 1 % 2); } if (otherInAlliance) { otherAlliance.AllianceMessage(1070739 + (int)status, (inAlliance ? Alliance.Name : Name)); otherAlliance.InvalidateMemberProperties(); } else { g.GuildMessage(1070739 + (int)status, (inAlliance ? Alliance.Name : Name)); g.InvalidateMemberProperties(); } g.AcceptedWars.Remove(g.FindActiveWar(this)); } } } for (int i = 0; i < PendingWars.Count; i++) { WarDeclaration w = PendingWars[i]; Guild g = w.Opponent; if (w.Status != WarStatus.Pending) { //All sanity in here PendingWars.Remove(w); if (g != null) { g.PendingWars.Remove(g.FindPendingWar(this)); } } } }