[Orxonox-commit 6019] r10678 - code/branches/AI_HS15/src/orxonox/controllers
gania at orxonox.net
gania at orxonox.net
Tue Oct 20 20:17:52 CEST 2015
Author: gania
Date: 2015-10-20 20:17:50 +0200 (Tue, 20 Oct 2015)
New Revision: 10678
Added:
code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc
code/branches/AI_HS15/src/orxonox/controllers/DivisionController.h
code/branches/AI_HS15/src/orxonox/controllers/FleetController.cc
code/branches/AI_HS15/src/orxonox/controllers/FleetController.h
code/branches/AI_HS15/src/orxonox/controllers/LeaderController.cc
code/branches/AI_HS15/src/orxonox/controllers/LeaderController.h
code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc
code/branches/AI_HS15/src/orxonox/controllers/SectionController.h
code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc
code/branches/AI_HS15/src/orxonox/controllers/WingmanController.h
Modified:
code/branches/AI_HS15/src/orxonox/controllers/AIController.cc
code/branches/AI_HS15/src/orxonox/controllers/AIController.h
code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.cc
code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h
code/branches/AI_HS15/src/orxonox/controllers/CMakeLists.txt
code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc
code/branches/AI_HS15/src/orxonox/controllers/FormationController.h
Log:
Didn't delete old structure, but intend to replace it with new: FleetController is a Base type, it should manage divisions, each consisting of 2 sections, each section is a pair of a Leader and a Wingman. Divisions can have different formation types: Echelon, Wall, Finger Four, Diamond, Vee. Leader decides what target to shoot first, wingmen cover Leader's rear. When 2 sections merge into a division, one of the Leaders becomes a Wingman. FleetController asks Leaders to attack targets, fly to positions or protect targets.
Modified: code/branches/AI_HS15/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/AIController.cc 2015-10-19 20:49:41 UTC (rev 10677)
+++ code/branches/AI_HS15/src/orxonox/controllers/AIController.cc 2015-10-20 18:17:50 UTC (rev 10678)
@@ -328,4 +328,4 @@
}
-}
+}
\ No newline at end of file
Modified: code/branches/AI_HS15/src/orxonox/controllers/AIController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/AIController.h 2015-10-19 20:49:41 UTC (rev 10677)
+++ code/branches/AI_HS15/src/orxonox/controllers/AIController.h 2015-10-20 18:17:50 UTC (rev 10678)
@@ -60,4 +60,4 @@
};
}
-#endif /* _AIController_H__ */
+#endif /* _AIController_H__ */
\ No newline at end of file
Modified: code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.cc 2015-10-19 20:49:41 UTC (rev 10677)
+++ code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.cc 2015-10-20 18:17:50 UTC (rev 10678)
@@ -290,4 +290,4 @@
this->updatePointsOfInterest("PickupSpawner", 20.0f); // take pickup en passant if there is a default waypoint
}
-}
+}
\ No newline at end of file
Modified: code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h 2015-10-19 20:49:41 UTC (rev 10677)
+++ code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h 2015-10-20 18:17:50 UTC (rev 10678)
@@ -100,4 +100,4 @@
};
}
-#endif /* _ArtificialController_H__ */
+#endif /* _ArtificialController_H__ */
\ No newline at end of file
Modified: code/branches/AI_HS15/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/CMakeLists.txt 2015-10-19 20:49:41 UTC (rev 10677)
+++ code/branches/AI_HS15/src/orxonox/controllers/CMakeLists.txt 2015-10-20 18:17:50 UTC (rev 10678)
@@ -10,4 +10,9 @@
DroneController.cc
FormationController.cc
ControllerDirector.cc
+ FleetController.cc
+ DivisionController.cc
+ SectionController.cc
+ LeaderController.cc
+ WingmanController.cc
)
Added: code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/DivisionController.cc 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,60 @@
+/*
+ * 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:
+ * Dominik Solenicki
+ *
+ */
+
+#include "DivisionController.h"
+
+
+namespace orxonox
+{
+
+ RegisterClass(DivisionController);
+
+ DivisionController::DivisionController(Context* context) : FleetController(context)
+ {
+ RegisterObject(DivisionController);
+ }
+
+ DivisionController::~DivisionController()
+ {
+ if (this->isInitialized())
+ {
+
+ }
+ }
+
+ /*void DivisionController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(DivisionController, XMLPort, xmlelement, mode);
+
+ //XMLPortParam(DivisionController, "target_", setTarget, getTarget, xmlelement, mode).defaultValues(100.0f);
+ }*/
+
+
+
+
+}
Added: code/branches/AI_HS15/src/orxonox/controllers/DivisionController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/DivisionController.h (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/DivisionController.h 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,55 @@
+/*
+ * 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:
+ * Dominik Solenicki
+ *
+ */
+
+#ifndef _DivisionController_H__
+#define _DivisionController_H__
+
+#include "controllers/FleetController.h"
+
+
+namespace orxonox
+{
+ class _OrxonoxExport DivisionController : public FleetController
+ {
+ public:
+ DivisionController(Context* context);
+ virtual ~DivisionController();
+
+ //virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+
+
+
+ protected:
+
+
+ private:
+ };
+}
+
+#endif /* _DivisionController_H__ */
Added: code/branches/AI_HS15/src/orxonox/controllers/FleetController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/FleetController.cc (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/FleetController.cc 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,69 @@
+/*
+ * 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:
+ * Dominik Solenicki
+ *
+ */
+
+#include "FleetController.h"
+
+
+namespace orxonox
+{
+
+ RegisterClass(FleetController);
+
+ FleetController::FleetController(Context* context) : Controller(context)
+ {
+ RegisterObject(FleetController);
+
+ this->gameGoal_ = DOMINATE;
+ this->goalPosition_ = NULL;
+ this->goalTarget_ = NULL;
+ this->goalProtect_ = NULL;
+ }
+
+ FleetController::~FleetController()
+ {
+ if (this->isInitialized())
+ {
+
+ }
+ }
+
+ void FleetController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(FleetController, XMLPort, xmlelement, mode);
+
+ //XMLPortObject(FleetController, GameGoal, "gameGoal", setGameGoal, getGameGoal, xmlelement, mode).defaultValues(DOMINATE);
+ //XMLPortParam(FleetController, "goalPosition", setGoalPosition, getGoalPosition, xmlelement, mode).defaultValues(NULL);
+ //XMLPortParam(FleetController, "goalTarget", setGoalTarget, getGoalTarget, xmlelement, mode).defaultValues(NULL);
+ //XMLPortParam(FleetController, "goalProtect", setGoalProtect, getGoalProtect, xmlelement, mode).defaultValues(NULL);
+
+ }
+
+
+
+
+}
Added: code/branches/AI_HS15/src/orxonox/controllers/FleetController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/FleetController.h (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/FleetController.h 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,116 @@
+/*
+ * 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:
+ * Dominik Solenicki
+ *
+ */
+
+#ifndef _FleetController_H__
+#define _FleetController_H__
+
+#include "controllers/Controller.h"
+
+#include "OrxonoxPrereqs.h"
+#include "core/class/Super.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "core/command/ConsoleCommandIncludes.h"
+#include "core/command/Executor.h"
+
+#include <vector>
+#include "util/Math.h"
+#include <climits>
+
+#include "tools/Timer.h"
+#include "tools/interfaces/Tickable.h"
+
+#include "worldentities/ControllableEntity.h"
+#include "worldentities/pawns/SpaceShip.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/pawns/TeamBaseMatchBase.h"
+
+#include "gametypes/TeamDeathmatch.h"
+#include "gametypes/Dynamicmatch.h"
+#include "gametypes/Mission.h"
+#include "gametypes/Gametype.h"
+
+#include "controllers/WaypointPatrolController.h"
+#include "controllers/NewHumanController.h"
+#include "controllers/DroneController.h"
+
+
+namespace orxonox
+{
+
+ class _OrxonoxExport FleetController : public Controller
+ {
+ public:
+ FleetController(Context* context);
+ virtual ~FleetController();
+
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+ //gameGoal_ is to be set in XML
+ //DOMINATE is default, makes AI want to be the only team alive
+ //MOVE makes a fleet move to a set absolute position (set in variable goalPosition_)
+ //DESTROY makes a fleet destroy a target (set in variable goalTarget_)
+ //PROTECT makes a fleet protect a target (set in variable goalProtect_)
+ enum GameGoal {DOMINATE, MOVE, DESTROY, PROTECT};
+
+ /*void setGameGoal(GameGoal gameGoal)
+ { this->gameGoal_ = gameGoal; }
+ GameGoal getGameGoal() const
+ { return this->gameGoal_; }
+
+ void setGoalPosition(Vector3* goalPosition)
+ { this->goalPosition_ = goalPosition; }
+ Vector3* getGoalPosition() const
+ { return this->goalPosition_; }
+
+ void setGoalTarget(Pawn* goalTarget)
+ { this->goalTarget_ = goalTarget; }
+ Pawn* getGoalTarget() const
+ { return this->goalTarget_; }
+
+ void setGoalProtect(Pawn* goalProtect)
+ { this->goalProtect_ = goalProtect; }
+ Pawn* getGoalProtect() const
+ { return this->goalProtect_; }*/
+
+
+
+ protected:
+
+
+ GameGoal gameGoal_;
+ Vector3* goalPosition_;
+ WeakPtr<Pawn> goalTarget_;
+ WeakPtr<Pawn> goalProtect_;
+
+
+ };
+}
+
+#endif /* _FleetController_H__ */
Modified: code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc 2015-10-19 20:49:41 UTC (rev 10677)
+++ code/branches/AI_HS15/src/orxonox/controllers/FormationController.cc 2015-10-20 18:17:50 UTC (rev 10678)
@@ -1124,4 +1124,4 @@
if (this->target_ && this->getControllableEntity() == static_cast<ControllableEntity*>(this->target_))
this->forgetTarget();
}
-}
+}
\ No newline at end of file
Modified: code/branches/AI_HS15/src/orxonox/controllers/FormationController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/FormationController.h 2015-10-19 20:49:41 UTC (rev 10677)
+++ code/branches/AI_HS15/src/orxonox/controllers/FormationController.h 2015-10-20 18:17:50 UTC (rev 10678)
@@ -184,4 +184,3 @@
}
#endif /* _FormationController_h__ */
-
Added: code/branches/AI_HS15/src/orxonox/controllers/LeaderController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/LeaderController.cc (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/LeaderController.cc 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,66 @@
+/*
+ * 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:
+ * Dominik Solenicki
+ *
+ */
+
+#include "LeaderController.h"
+
+
+
+namespace orxonox
+{
+ const float LeaderController::ACTION_INTERVAL = 1.0f;
+
+ RegisterClass(LeaderController);
+
+ LeaderController::LeaderController(Context* context) : SectionController(context)
+ {
+ RegisterObject(LeaderController);
+ this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&LeaderController::action, this)));
+ }
+
+ LeaderController::~LeaderController()
+ {
+ }
+
+ void LeaderController::action()
+ {
+
+ }
+
+ void LeaderController::tick(float dt)
+ {
+
+
+ SUPER(LeaderController, tick, dt);
+ }
+//**********************************************NEW
+ void LeaderController::defaultBehaviour(float maxrand)
+ {
+
+ }
+
+}
Added: code/branches/AI_HS15/src/orxonox/controllers/LeaderController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/LeaderController.h (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/LeaderController.h 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,57 @@
+/*
+ * 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 _LeaderController_H__
+#define _LeaderController_H__
+
+#include "SectionController.h"
+
+
+namespace orxonox
+{
+ class _OrxonoxExport LeaderController : public SectionController, public Tickable
+ {
+ public:
+ LeaderController(Context* context);
+ virtual ~LeaderController();
+
+ virtual void tick(float dt); //<! Carrying out the targets set in action().
+
+ protected:
+ virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
+ void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.
+
+ private:
+ static const float ACTION_INTERVAL;
+
+ Timer actionTimer_; //<! Regularly calls action().
+
+ };
+}
+
+#endif /* _LeaderController_H__ */
Added: code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/SectionController.cc 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,59 @@
+/*
+ * 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:
+ * Dominik Solenicki
+ *
+ */
+
+#include "SectionController.h"
+
+namespace orxonox
+{
+
+ RegisterClass(SectionController);
+
+ SectionController::SectionController(Context* context) : DivisionController(context)
+ {
+ RegisterObject(SectionController);
+ }
+
+ SectionController::~SectionController()
+ {
+ if (this->isInitialized())
+ {
+
+ }
+ }
+
+ /*void SectionController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(SectionController, XMLPort, xmlelement, mode);
+
+ //XMLPortParam(SectionController, "target_", setTarget, getTarget, xmlelement, mode).defaultValues(100.0f);
+ }*/
+
+
+
+
+}
Added: code/branches/AI_HS15/src/orxonox/controllers/SectionController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/SectionController.h (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/SectionController.h 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,55 @@
+/*
+ * 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:
+ * Dominik Solenicki
+ *
+ */
+
+#ifndef _SectionController_H__
+#define _SectionController_H__
+
+#include "controllers/DivisionController.h"
+
+
+namespace orxonox
+{
+ class _OrxonoxExport SectionController : public DivisionController
+ {
+ public:
+ SectionController(Context* context);
+ virtual ~SectionController();
+
+ //virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
+
+
+
+ protected:
+
+
+ private:
+ };
+}
+
+#endif /* _SectionController_H__ */
Added: code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/WingmanController.cc 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,72 @@
+/*
+ * 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:
+ * Dominik Solenicki
+ *
+ */
+
+#include "WingmanController.h"
+
+
+namespace orxonox
+{
+ const float WingmanController::ACTION_INTERVAL = 1.0f;
+
+ RegisterClass(WingmanController);
+
+ WingmanController::WingmanController(Context* context) : SectionController(context)
+ {
+ RegisterObject(WingmanController);
+ this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&WingmanController::action, this)));
+ }
+
+ WingmanController::~WingmanController()
+ {
+ }
+
+ /* void WingmanController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(WingmanController, XMLPort, xmlelement, mode);
+
+ XMLPortParam(WingmanController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
+ XMLPortObject(WingmanController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
+ }*/
+ void WingmanController::action()
+ {
+
+ }
+
+ void WingmanController::tick(float dt)
+ {
+
+
+ SUPER(WingmanController, tick, dt);
+ }
+//**********************************************NEW
+ void WingmanController::defaultBehaviour(float maxrand)
+ {
+
+ }
+
+}
Added: code/branches/AI_HS15/src/orxonox/controllers/WingmanController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/WingmanController.h (rev 0)
+++ code/branches/AI_HS15/src/orxonox/controllers/WingmanController.h 2015-10-20 18:17:50 UTC (rev 10678)
@@ -0,0 +1,59 @@
+/*
+ * 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 _WingmanController_H__
+#define _WingmanController_H__
+
+
+#include "SectionController.h"
+
+
+namespace orxonox
+{
+ class _OrxonoxExport WingmanController : public SectionController, public Tickable
+ {
+ public:
+ WingmanController(Context* context);
+ virtual ~WingmanController();
+ //virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void tick(float dt); //<! Carrying out the targets set in action().
+
+ protected:
+ virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
+ void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.
+
+
+ private:
+ static const float ACTION_INTERVAL;
+
+ Timer actionTimer_; //<! Regularly calls action().
+
+ };
+}
+
+#endif /* _WingmanController_H__ */
More information about the Orxonox-commit
mailing list