message: Prepare FactoryListBoxItem fields before construction
diff: @@ -70,15 +70,16 @@ void FactoryListBox::addItem(Factory* factory)
  }
  }
  - mItems.push_back(new FactoryListBoxItem(factory));
  -
  /// \fixme super sloppy
  - FactoryListBoxItem* item = static_cast<FactoryListBoxItem*>(mItems.back());
  - item->text = factory->name();
  - item->icon_slice = (factory->state() == StructureState::Destroyed) ? NAS2D::Point<int>{414, 368} :
  - (item->text == constants::UNDERGROUND_FACTORY) ? NAS2D::Point<int>{138, 276} :
  - (item->text == constants::SEED_FACTORY) ? NAS2D::Point<int>{460, 368} :
  + const auto& text = factory->name();
  + const auto iconPosition = (factory->state() == StructureState::Destroyed) ? NAS2D::Point<int>{414, 368} :
  + (text == constants::UNDERGROUND_FACTORY) ? NAS2D::Point<int>{138, 276} :
  + (text == constants::SEED_FACTORY) ? NAS2D::Point<int>{460, 368} :
  NAS2D::Point<int>{0, 46}; // Surface factory
  + mItems.push_back(new FactoryListBoxItem(factory));
  + FactoryListBoxItem* item = static_cast<FactoryListBoxItem*>(mItems.back());
  + item->text = text;
  + item->icon_slice = iconPosition;
  updateScrollLayout();
  }
  