/* * ORXONOX - the hottest 3D action shooter ever to exist * > www.orxonox.net < * * * License notice: * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * Author: * Fabian 'x3n' Landau * Co-authors: * ... * */ #ifndef _ActionpointController_H__ #define _ActionpointController_H__ #include "controllers/FightingController.h" namespace orxonox { namespace Action { enum Value { NONE, FLY, FIGHT, PROTECT, FIGHTALL, ATTACK }; } struct Point { Action::Value action; std::string name; Vector3 position; bool inLoop; } ; class _OrxonoxExport ActionpointController : public FightingController { public: //----[language demanded functions]---- ActionpointController(Context* context); virtual ~ActionpointController(); //----[language demanded functions]---- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); virtual void tick(float dt); void addActionpoint(WorldEntity* waypoint); WorldEntity* getActionpoint(unsigned int index) const; virtual void stayNearProtect(); virtual void action(); // vector, std::vector loop, bool b); Action::Value getAction (); std::string getActionName(); void setAction (Action::Value action); void setAction (Action::Value action, ControllableEntity* target); void setAction (Action::Value action, const Vector3& target); void setAction (Action::Value action, const Vector3& target, const Quaternion& orient ); protected: void startAttackingEnemiesThatAreClose(); //----[Actionpoint information]---- Action::Value action_; std::string protectName_; std::string targetName_; std::vector > actionpoints_; float squaredaccuracy_; std::vector parsedActionpoints_; std::vector loopActionpoints_; bool bInLoop_; bool bLoop_; bool bEndLoop_; bool bTakenOver_; //----[/Actionpoint information]---- void setProtect (ControllableEntity* protect); ControllableEntity* getProtect (); WeakPtr protect_; void setClosestTarget(); Pawn* closestTarget(); //----[Actionpoint methods]---- void executeActionpoint(); void nextActionpoint(); void fillLoop(); void fillLoopReversed(); void moveBackToTop(); //----[Actionpoint methods]---- private: }; } #endif /* _ActionpointController_H__ */