void TargetedIndicator::onInit()
        {
          InternalMessage("Display","Display::TargetedIndicator::onInit Entering") ;

          // enemies if they are in different teams
          m_is_enemy_target = getObjectTo()->getChild<Model::Transponder>()->getTeam() != getObjectFrom()->getChild<Model::Transponder>()->getTeam() ;

          if (m_is_enemy_target)
          {
            ++m_count ;
            if (m_count == 1)
              createIndicator() ;
          }
          InternalMessage("Display","Display::TargetedIndicator::onInit Leaving") ;
        }
Beispiel #2
0
 void Link::write(Dico& dico) const noexcept
 {
     sObject     from    = getObjectFrom();
     sObject     to      = getObjectTo();
     
     if(from && to)
     {
         dico[Tags::from] = {(long)from->getId(), (long)getOutletIndex()};
         dico[Tags::to] = {(long)to->getId(), (long)getInletIndex()};
     }
     else
     {
         dico.erase(Tags::from);
         dico.erase(Tags::to);
     }
 }
Beispiel #3
0
 Link::~Link()
 {
     sObject     from    = getObjectFrom();
     sObject     to      = getObjectTo();
     if(from && to)
     {
         Object::sOutlet outlet  = from->getOutlet(m_index_outlet);
         if(outlet)
         {
             outlet->erase(to, m_index_outlet);
         }
         Object::sInlet inlet    = to->getInlet(m_index_intlet);
         if(inlet)
         {
             inlet->erase(from, m_index_intlet);
         }
     }
 }