| 274 | } |
| 275 | |
| 276 | void TechnoExt::ProcessDigitalDisplays(TechnoClass* pThis) |
| 277 | { |
| 278 | if (!Phobos::Config::DigitalDisplay_Enable) |
| 279 | return; |
| 280 | |
| 281 | const auto pType = pThis->GetTechnoType(); |
| 282 | const auto pTypeExt = TechnoTypeExt::ExtMap.Find(pType); |
| 283 | |
| 284 | if (pTypeExt->DigitalDisplay_Disable) |
| 285 | return; |
| 286 | |
| 287 | int length = 17; |
| 288 | ValueableVector<DigitalDisplayTypeClass*>* pDisplayTypes = nullptr; |
| 289 | const auto whatAmI = pThis->WhatAmI(); |
| 290 | |
| 291 | if (!pTypeExt->DigitalDisplayTypes.empty()) |
| 292 | { |
| 293 | pDisplayTypes = &pTypeExt->DigitalDisplayTypes; |
| 294 | } |
| 295 | else |
| 296 | { |
| 297 | switch (whatAmI) |
| 298 | { |
| 299 | case AbstractType::Building: |
| 300 | { |
| 301 | pDisplayTypes = &RulesExt::Global()->Buildings_DefaultDigitalDisplayTypes; |
| 302 | const auto pBuildingType = static_cast<BuildingTypeClass*>(pThis->GetTechnoType()); |
| 303 | const int height = pBuildingType->GetFoundationHeight(false); |
| 304 | length = height * 7 + height / 2; |
| 305 | break; |
| 306 | } |
| 307 | case AbstractType::Infantry: |
| 308 | { |
| 309 | pDisplayTypes = &RulesExt::Global()->Infantry_DefaultDigitalDisplayTypes; |
| 310 | length = 8; |
| 311 | break; |
| 312 | } |
| 313 | case AbstractType::Unit: |
| 314 | { |
| 315 | pDisplayTypes = &RulesExt::Global()->Vehicles_DefaultDigitalDisplayTypes; |
| 316 | break; |
| 317 | } |
| 318 | case AbstractType::Aircraft: |
| 319 | { |
| 320 | pDisplayTypes = &RulesExt::Global()->Aircraft_DefaultDigitalDisplayTypes; |
| 321 | break; |
| 322 | } |
| 323 | default: |
| 324 | return; |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | const auto pShield = TechnoExt::ExtMap.Find(pThis)->Shield.get(); |
| 329 | const bool hasShield = pShield && !pShield->IsBrokenAndNonRespawning(); |
| 330 | const bool isBuilding = whatAmI == AbstractType::Building; |
| 331 | const bool isInfantry = whatAmI == AbstractType::Infantry; |
| 332 | |
| 333 | for (DigitalDisplayTypeClass*& pDisplayType : *pDisplayTypes) |
nothing calls this directly
no test coverage detected