| 218 | } |
| 219 | |
| 220 | bool Window_VarList::DataIsValid(int range_index) { |
| 221 | switch (mode) { |
| 222 | case eSwitch: |
| 223 | return Main_Data::game_switches->IsValid(range_index); |
| 224 | case eVariable: |
| 225 | return Main_Data::game_variables->IsValid(range_index); |
| 226 | case eItem: |
| 227 | return range_index > 0 && range_index <= static_cast<int>(lcf::Data::items.size()); |
| 228 | case eTroop: |
| 229 | return range_index > 0 && range_index <= static_cast<int>(lcf::Data::troops.size()); |
| 230 | case eMap: |
| 231 | return range_index > 0 && range_index <= (lcf::Data::treemap.maps.size() > 0 ? lcf::Data::treemap.maps.back().ID : 0); |
| 232 | case eHeal: |
| 233 | return range_index > 0 && range_index <= static_cast<int>(Main_Data::game_party->GetActors().size()) + 1; |
| 234 | case eLevel: |
| 235 | return range_index > 0 && range_index <= static_cast<int>(Main_Data::game_party->GetActors().size()); |
| 236 | case eCommonEvent: |
| 237 | return range_index > 0 && range_index <= static_cast<int>(lcf::Data::commonevents.size()); |
| 238 | case eMapEvent: |
| 239 | return Game_Map::GetEvent(range_index) != nullptr; |
| 240 | case eString: |
| 241 | return range_index > 0 && range_index <= Main_Data::game_strings->GetSizeWithLimit(); |
| 242 | default: |
| 243 | break; |
| 244 | } |
| 245 | return false; |
| 246 | } |
| 247 | |
| 248 | int Window_VarList::GetNumElements(Mode mode) { |
| 249 | switch (mode) { |
nothing calls this directly
no test coverage detected