Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 28, 2009, 2:45:37 PM (15 years ago)
Author:
rgrieder
Message:

Found a way to write orxonox_cast<T*> instead of orxonox_cast<T> so that the syntax resembles dynamic_cast<T*>.

Location:
code/branches/core4/src/orxonox/objects/controllers
Files:
2 edited

Legend:

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

    r3223 r3239  
    181181        if (entity1->getXMLController())
    182182        {
    183             WaypointPatrolController* wpc = orxonox_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 = orxonox_cast<WaypointPatrolController>(entity2->getXMLController());
     189            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController*>(entity2->getXMLController());
    190190            if (wpc)
    191191                team2 = wpc->getTeam();
    192192        }
    193193
    194         TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch>(gametype);
     194        TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);
    195195        if (tdm)
    196196        {
     
    203203
    204204        TeamBaseMatchBase* base = 0;
    205         base = orxonox_cast<TeamBaseMatchBase>(entity1);
     205        base = orxonox_cast<TeamBaseMatchBase*>(entity1);
    206206        if (base)
    207207        {
     
    219219            }
    220220        }
    221         base = orxonox_cast<TeamBaseMatchBase>(entity2);
     221        base = orxonox_cast<TeamBaseMatchBase*>(entity2);
    222222        if (base)
    223223        {
  • code/branches/core4/src/orxonox/objects/controllers/HumanController.cc

    r3223 r3239  
    161161        if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
    162162        {
    163             Pawn* pawn = orxonox_cast<Pawn>(HumanController::localController_s->controllableEntity_);
     163            Pawn* pawn = orxonox_cast<Pawn*>(HumanController::localController_s->controllableEntity_);
    164164            if (pawn)
    165165                pawn->kill();
     
    196196    {
    197197        if (HumanController::localController_s)
    198             return orxonox_cast<Pawn>(HumanController::localController_s->getControllableEntity());
     198            return orxonox_cast<Pawn*>(HumanController::localController_s->getControllableEntity());
    199199        else
    200200            return NULL;
Note: See TracChangeset for help on using the changeset viewer.