Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 23, 2009, 7:28:48 PM (15 years ago)
Author:
rgrieder
Message:

Add a new core-feature: orxonox_cast<T>()
The functions casts objects like dynamic_cast, but uses the identifier instead for MSVC (much faster) and is just a redirection to dynamic_cast for GCC.
Also replaced almost all dynamic_casts (of course only those related to the class hierarchy).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core4/src/orxonox/objects/controllers/ArtificialController.cc

    r3196 r3223  
    181181        if (entity1->getXMLController())
    182182        {
    183             WaypointPatrolController* wpc = dynamic_cast<WaypointPatrolController*>(entity1->getXMLController());
     183            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController>(entity1->getXMLController());
    184184            if (wpc)
    185185                team1 = wpc->getTeam();
     
    187187        if (entity2->getXMLController())
    188188        {
    189             WaypointPatrolController* wpc = dynamic_cast<WaypointPatrolController*>(entity2->getXMLController());
     189            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController>(entity2->getXMLController());
    190190            if (wpc)
    191191                team2 = wpc->getTeam();
    192192        }
    193193
    194         TeamDeathmatch* tdm = dynamic_cast<TeamDeathmatch*>(gametype);
     194        TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch>(gametype);
    195195        if (tdm)
    196196        {
     
    203203
    204204        TeamBaseMatchBase* base = 0;
    205         base = dynamic_cast<TeamBaseMatchBase*>(entity1);
     205        base = orxonox_cast<TeamBaseMatchBase>(entity1);
    206206        if (base)
    207207        {
     
    219219            }
    220220        }
    221         base = dynamic_cast<TeamBaseMatchBase*>(entity2);
     221        base = orxonox_cast<TeamBaseMatchBase>(entity2);
    222222        if (base)
    223223        {
Note: See TracChangeset for help on using the changeset viewer.