| 1751 | } |
| 1752 | |
| 1753 | void InGameUI::DrawGroupInfo(EntityAI* vehicle) |
| 1754 | { |
| 1755 | AIUnit* unit = GWorld->FocusOn(); |
| 1756 | PoseidonAssert(unit); |
| 1757 | AISubgroup* subgroup = unit->GetSubgroup(); |
| 1758 | PoseidonAssert(subgroup); |
| 1759 | AIGroup* group = subgroup->GetGroup(); |
| 1760 | PoseidonAssert(group); |
| 1761 | |
| 1762 | bool changed = false; |
| 1763 | bool isValid = false; |
| 1764 | int i; |
| 1765 | for (i = 0; i < MAX_UNITS_PER_GROUP; i++) |
| 1766 | { |
| 1767 | AIUnit* u = group->UnitWithID(i + 1); |
| 1768 | UnitDescription& info = _groupInfo[i]; |
| 1769 | bool valid = (u && u->GetSubgroup() && !group->GetReportedDown(u) && unit->IsGroupLeader()); |
| 1770 | if (valid != info.valid) |
| 1771 | { |
| 1772 | info.valid = valid; |
| 1773 | changed = true; |
| 1774 | } |
| 1775 | if (!valid) |
| 1776 | { |
| 1777 | continue; |
| 1778 | } |
| 1779 | |
| 1780 | isValid = true; |
| 1781 | EntityAI* veh = u->GetVehicle(); |
| 1782 | Transport* trans = u->GetVehicleIn(); |
| 1783 | // const VehicleType *type = veh->GetType(); |
| 1784 | |
| 1785 | if (trans != info.vehicle) |
| 1786 | { |
| 1787 | info.vehicle = trans; |
| 1788 | changed = true; |
| 1789 | } |
| 1790 | |
| 1791 | if (u->GetPerson() != info.person) |
| 1792 | { |
| 1793 | info.person = u->GetPerson(); |
| 1794 | changed = true; |
| 1795 | } |
| 1796 | |
| 1797 | AIUnit::ResourceState problemStatus = group->GetWorstStateReported(u); |
| 1798 | bool problems = problemStatus >= AIUnit::RSCritical; |
| 1799 | if (problems != info.problems) |
| 1800 | { |
| 1801 | info.problems = problems; |
| 1802 | changed = true; |
| 1803 | } |
| 1804 | |
| 1805 | if (u->GetSemaphore() != info.semaphore) |
| 1806 | { |
| 1807 | info.semaphore = u->GetSemaphore(); |
| 1808 | changed = true; |
| 1809 | } |
| 1810 |
nothing calls this directly
no test coverage detected