Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 21, 2008, 2:35:24 PM (16 years ago)
Author:
rgrieder
Message:
  • Dots on the Radar actually disappear now when a Ship gets destroyed…
  • svn save to keep History of HUDText when renaming AND moving
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hud/src/orxonox/Radar.cc

    r1613 r1614  
    2323 *      Reto Grieder
    2424 *   Co-authors:
    25  *      ...
     25 *      Felix Schulthess
    2626 *
    2727 */
     
    3838#include "objects/SpaceShip.h"
    3939#include "core/CoreIncludes.h"
     40#include "RadarListener.h"
    4041//#include "core/ConfigValueIncludes.h"
    4142
    4243namespace orxonox
    4344{
    44     RadarListener::RadarListener()
    45     {
    46         RegisterRootObject(RadarListener);
    47     }
    48 
    4945    SetConsoleCommand(Radar, cycleNavigationFocus, true).setAccessLevel(AccessLevel::User);
    5046    SetConsoleCommand(Radar, releaseNavigationFocus, true).setAccessLevel(AccessLevel::User);
     
    8682    }
    8783
    88     /*void Radar::unregisterObject(RadarViewable* object)
    89     {
    90         if (this->focus_ == object)
    91             this->focus_ = 0;
    92         // TODO: check for focus
    93     }*/
    94 
    9584    const RadarViewable* Radar::getFocus()
    9685    {
     
    119108        for (Iterator<RadarListener> itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
    120109        {
     110            (*itListener)->radarTick(dt);
     111
    121112            for (Iterator<RadarViewable> itElement = ObjectList<RadarViewable>::begin(); itElement; ++itElement)
    122113            {
     
    124115                    (*itListener)->displayObject(*itElement, *itElement == this->focus_);
    125116            }
    126 
    127             (*itListener)->radarTick(dt);
    128 
    129             if (this->focus_ == 0)
    130                 (*itListener)->hideMarker();
    131117        }
    132118    }
     
    190176    }
    191177
     178    void Radar::listObjects() const
     179    {
     180        COUT(3) << "List of RadarObjects:\n";
     181        // iterate through all Radar Objects
     182        unsigned int i = 0;
     183        for (Iterator<RadarViewable> it = ObjectList<RadarViewable>::start(); it; ++it, ++i)
     184        {
     185            COUT(3) << i++ << ": " << (*it)->getWorldPosition() << std::endl;
     186        }
     187    }
     188
    192189
    193190    /*static*/ Radar& Radar::getInstance()
Note: See TracChangeset for help on using the changeset viewer.