public bool IsUnitChargingDefendingUnit(Unit chargingUnit, Unit defendingUnit) { if (!Charges.ContainsKey(chargingUnit)) { return(false); } return(Charges[chargingUnit].Contains(defendingUnit)); }
public void AddCharge(Unit defendingUnit, Unit attackingUnit) { defendingUnit.InConflict = true; attackingUnit.InConflict = true; if (Charges.ContainsKey(attackingUnit)) { Charges[attackingUnit].Add(defendingUnit); } else { Charges[attackingUnit] = new List <Unit>() { defendingUnit }; } AddChargeToTempConficts(defendingUnit, attackingUnit); }
public bool ChargesContainsKey(Unit unit) { return(Charges.ContainsKey(unit)); }