| 138 | |
| 139 | |
| 140 | void cWindow::GetSlots(cPlayer & a_Player, cItems & a_Slots) const |
| 141 | { |
| 142 | a_Slots.clear(); |
| 143 | a_Slots.reserve(GetNumSlots()); |
| 144 | for (cSlotAreas::const_iterator itr = m_SlotAreas.begin(), end = m_SlotAreas.end(); itr != end; ++itr) |
| 145 | { |
| 146 | int NumSlots = (*itr)->GetNumSlots(); |
| 147 | for (int i = 0; i < NumSlots; i++) |
| 148 | { |
| 149 | |
| 150 | const cItem * Item = (*itr)->GetSlot(i, a_Player); |
| 151 | if (Item == NULL) |
| 152 | { |
| 153 | a_Slots.push_back(cItem()); |
| 154 | } |
| 155 | else |
| 156 | { |
| 157 | a_Slots.push_back(*Item); |
| 158 | } |
| 159 | } |
| 160 | } // for itr - m_SlotAreas[] |
| 161 | } |
| 162 | |
| 163 | |
| 164 | |