Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 27, 2009, 1:44:48 AM (15 years ago)
Author:
landauf
Message:

added bot-support for TeamBaseMatch (and some small fixes)

File:
1 edited

Legend:

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

    r3049 r3086  
    3636#include "objects/gametypes/TeamDeathmatch.h"
    3737#include "objects/controllers/WaypointPatrolController.h"
     38#include "objects/worldentities/pawns/TeamBaseMatchBase.h"
    3839
    3940namespace orxonox
     
    203204        }
    204205
     206        TeamBaseMatchBase* base = 0;
     207        base = dynamic_cast<TeamBaseMatchBase*>(entity1);
     208        if (base)
     209        {
     210            switch (base->getState())
     211            {
     212                case BaseState::controlTeam1:
     213                    team1 = 0;
     214                    break;
     215                case BaseState::controlTeam2:
     216                    team1 = 1;
     217                    break;
     218                case BaseState::uncontrolled:
     219                default:
     220                    team1 = -1;
     221            }
     222        }
     223        base = dynamic_cast<TeamBaseMatchBase*>(entity2);
     224        if (base)
     225        {
     226            switch (base->getState())
     227            {
     228                case BaseState::controlTeam1:
     229                    team2 = 0;
     230                    break;
     231                case BaseState::controlTeam2:
     232                    team2 = 1;
     233                    break;
     234                case BaseState::uncontrolled:
     235                default:
     236                    team2 = -1;
     237            }
     238        }
     239
    205240        return (team1 == team2 && team1 != -1);
    206241    }
Note: See TracChangeset for help on using the changeset viewer.