public bool TryGetRank(Character member, out GroupRank rank) { GroupDivision div = Divisions.Find(x => x.DatabaseId == member.DivisionId); rank = div.Ranks.Find(x => x.DatabaseId == member.RankId); return(rank != null); }
internal void Remove(Division division) { WorkerSQL.DeleteByDivisiontId(division.Id); DivisionSQL.DeleteById(division.Id); Division deleteDivision = Divisions.Find(d => d.Id == division.Id); Divisions.Remove(division); }
public string GetDivisionName(Character member) { GroupDivision div = Divisions.Find(x => x.DatabaseId == member.DivisionId); if (div != null) { return(div.Name); } else { return(""); } }
public string GetRankName(Character member) { GroupDivision div = Divisions.Find(x => x.DatabaseId == member.DivisionId); GroupRank rank = div.Ranks.Find(x => x.DatabaseId == member.RankId); if (rank != null) { return(rank.Name); } else { return(""); } }
public void ClearGuarding(CDivision division) { if (division.GuardPairing != Guid.Empty) { CDivision other = Divisions.Find(i => i.GuardPairing == division.ID); division.GuardPairing = Guid.Empty; if (other != null) { other.GuardPairing = Guid.Empty; } else { throw new Exception(MISSING_GUARD_PAIR_MESSAGE); } } }
public int CheckDefensiveStrength(CDivision division) { int defense = 0; if (division.GuardPairing == Guid.Empty) { defense = (int)(division.UnitType.Stats[CUnit.STAT_DEFENSE]); } else { CDivision other = Divisions.Find(i => i.GuardPairing == division.ID); if (other != null) { defense = (int)(other.UnitType.Stats[CUnit.STAT_DEFENSE]); } else { throw new Exception(MISSING_GUARD_PAIR_MESSAGE); } } return(defense); }
public bool TryGetDivision(Character member, out GroupDivision div) { div = Divisions.Find(x => x.DatabaseId == member.DivisionId); return(div != null); }