[Gcblue-commits] gcb_wx/include/ai tcCAPMission.h, NONE, 1.1 tcMission.h, NONE, 1.1 tcMissionManage
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-09-28 02:01:57
|
Update of /cvsroot/gcblue/gcb_wx/include/ai In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32752/include/ai Added Files: tcCAPMission.h tcMission.h tcMissionManager.h Log Message: Initial airbase automation work --- NEW FILE: tcMissionManager.h --- /** ** @file tcMissionManager.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB 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 GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if _MSC_VER > 1000 #pragma once #endif #ifndef _TCMISSIONMANAGER_H_ #define _TCMISSIONMANAGER_H_ #include <map> #include <vector> class tcFlightPort; class tcMission; class tcAirObject; /** * Organizes and controls missions for aircraft in flightport. * * Select aircraft based on mission type and outfits according to mission * type. Set AI tasks (waypoints, etc) for aircraft to carry out mission. * Schedule launches. * * @see tcFlightPort */ class tcMissionManager { public: void AddMission(tcMission* mission_); std::vector<long>& GetAvailableAircraft(int targetMask); tcAirObject* GetAircraft(long id); void LaunchAircraft(long id); void Update(double t); tcMissionManager(tcFlightPort* fp); virtual ~tcMissionManager(); private: tcFlightPort* flightPort; std::vector<tcMission*> missions; std::map<long, unsigned int> reserved; ///< map of reserved aircraft (aircraft id, mission id) double lastUpdate; bool IsAircraftReserved(long id) const; void UpdateReserved(); }; #endif --- NEW FILE: tcCAPMission.h --- /** ** @file tcCAPMission.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB 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 GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if _MSC_VER > 1000 #pragma once #endif #ifndef _TCCAPMISSION_H_ #define _TCCAPMISSION_H_ #include "ai/tcMission.h" #include "simmath.h" class tcFlightPort; class tcPoint; class tcCAPMission : public tcMission { public: void SetStation(float lon_rad, float lat_rad); virtual void Update(double t); const tcCAPMission& operator=(const tcCAPMission& src); tcCAPMission(const tcCAPMission& src); tcCAPMission(); virtual ~tcCAPMission(); protected: unsigned int quantity; // number aircraft for mission tcPoint station; }; #endif --- NEW FILE: tcMission.h --- /** ** @file tcMission.h */ /* Copyright (C) 2006 Dewitt Colclough (de...@gc...) ** All rights reserved. ** This file is part of the Global Conflict Blue (GCB) program. ** GCB is free software; you can redistribute it and/or modify ** it under the terms of version 2 of the GNU General Public License as ** published by the Free Software Foundation. ** GCB 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 GCB; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #if _MSC_VER > 1000 #pragma once #endif #ifndef _TCMISSION_H_ #define _TCMISSION_H_ #include <string> #include <vector> class tcMissionManager; /** * Base class for air missions * * @see tcFlightPort, tcMissionManager */ class tcMission { public: unsigned int GetId() const; const std::vector<long>& GetMissionAircraft() const; void SetMissionManager(tcMissionManager* mm); virtual void Update(double t); const tcMission& operator=(const tcMission& src); tcMission(); tcMission(const tcMission& src); virtual ~tcMission(); protected: tcMissionManager* missionManager; std::vector<long> missionAircraft; std::string stage; private: static unsigned long nextId; ///< for assigning unique mission id unsigned int id; ///< unique identifier for mission }; #endif |