public bool CanAddUnitToQueue(CombatItemData cd) { //Console.WriteLine(GetMaxTrainCount()); //Console.WriteLine(GetTotalCount()); //Console.WriteLine(cd.GetHousingSpace()); return (GetMaxTrainCount() >= GetTotalCount() + cd.GetHousingSpace()); }
public bool CanAddUnit(CombatItemData cd) { bool result = false; if(cd != null) { if(IsSpellForge) { result = (GetMaxCapacity() >= GetUsedCapacity() + cd.GetHousingSpace()); } else { var cm = GetParent().GetLevel().GetComponentManager(); int maxCapacity = cm.GetTotalMaxHousing();//GetMaxCapacity(); int usedCapacity = cm.GetTotalUsedHousing();//GetUsedCapacity(); int housingSpace = cd.GetHousingSpace(); if (GetUsedCapacity() < GetMaxCapacity()) result = (maxCapacity >= usedCapacity + housingSpace); } } return result; }