[Gcblue-commits] gcb_wx/src/ai tcAIData.cpp,NONE,1.1 Nav.cpp,1.1,1.2 ScriptedTask.cpp,1.1,1.2 Script
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2005-06-01 00:14:11
|
Update of /cvsroot/gcblue/gcb_wx/src/ai In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9387/src/ai Modified Files: Nav.cpp ScriptedTask.cpp ScriptedTaskInterface.cpp SelfPreservation.cpp Task.cpp Added Files: tcAIData.cpp Log Message: namespace housekeeping Index: ScriptedTask.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/ScriptedTask.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScriptedTask.cpp 16 Feb 2005 23:13:49 -0000 1.1 --- ScriptedTask.cpp 1 Jun 2005 00:13:28 -0000 1.2 *************** *** 34,38 **** using namespace ai; ! using ScriptInterface::tcSimPythonInterface; --- 34,38 ---- using namespace ai; ! using scriptinterface::tcSimPythonInterface; Index: ScriptedTaskInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/ScriptedTaskInterface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ScriptedTaskInterface.cpp 2 Mar 2005 22:28:42 -0000 1.3 --- ScriptedTaskInterface.cpp 1 Jun 2005 00:13:28 -0000 1.4 *************** *** 39,43 **** using namespace ai; using namespace boost::python; ! using ScriptInterface::tcPlatformInterface; bool ScriptedTaskInterface::pythonInitialized = false; --- 39,43 ---- using namespace ai; using namespace boost::python; ! using scriptinterface::tcPlatformInterface; bool ScriptedTaskInterface::pythonInitialized = false; Index: Nav.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Nav.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Nav.cpp 4 Mar 2005 00:46:19 -0000 1.1 --- Nav.cpp 1 Jun 2005 00:13:28 -0000 1.2 *************** *** 35,39 **** using namespace ai; ! using ScriptInterface::tcPlatformInterface; void Nav::AddWaypoint(double lon_rad, double lat_rad, float alt_m) --- 35,39 ---- using namespace ai; ! using scriptinterface::tcPlatformInterface; void Nav::AddWaypoint(double lon_rad, double lat_rad, float alt_m) Index: Task.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/Task.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Task.cpp 24 Feb 2005 22:19:15 -0000 1.3 --- Task.cpp 1 Jun 2005 00:13:28 -0000 1.4 *************** *** 35,39 **** using namespace ai; ! using ScriptInterface::tcPlatformInterface; --- 35,39 ---- using namespace ai; ! using scriptinterface::tcPlatformInterface; --- NEW FILE: tcAIData.cpp --- /* ** Copyright (C) 2003 Dewitt Colclough (de...@tw...) ** 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 */ #include "stdwx.h" // precompiled header file #ifndef WX_PRECOMP #include "wx/wx.h" #endif #include "ai/tcAIData.h" #ifdef _DEBUG #define new DEBUG_NEW #endif using namespace std; using namespace ai; void tcOrder::SetDestinationDeg(float lon_deg, float lat_deg) { msDestination.Set(C_PIOVER180*lon_deg, C_PIOVER180*lat_deg); } tcOrder::tcOrder() { data = 0; mfTime = 0; msDestination.Set(0,0,0); mstrOrdername = "NULL"; } tcOrder::~tcOrder() { } void tcAIData::AddOrder(const tcOrder& wp) { if (maOrder.size() >= MAX_WAYPOINTS) {return;} // list full maOrder.push_back(wp); } void tcAIData::GetOrder(tcOrder& wp, unsigned n) { if (n >= maOrder.size()) { // out of range wp.mstrOrdername = "BAD WAYPOINT"; return; } wp = maOrder[n]; } void tcAIData::SetOrder(const tcOrder& wp, unsigned n) { if (n >= maOrder.size()) {return;} // out of range maOrder[n] = wp; } void tcAIData::DeleteOrder(unsigned n) { if (n >= maOrder.size()) {return;} // out of range maOrder.erase(maOrder.begin() + n); } void tcAIData::InsertOrderBefore(const tcOrder& wp, unsigned n) { unsigned nSize = (unsigned)maOrder.size(); if (nSize >= MAX_WAYPOINTS) {return;} // list full if (n >= nSize) {return;} // out of range maOrder.insert(maOrder.begin() + n, wp); } void tcAIData::ClearOrders(void) { maOrder.clear(); mnCurrentOrder = 0; } bool tcAIData::HasOrders(void) { return (mnCurrentOrder < maOrder.size()); } tcOrder tcAIData::GetCurrentOrder(void) { tcOrder o; GetOrder(o,mnCurrentOrder); return o; } /** * Move to next order and clear script * variables. */ void tcAIData::CompletedOrder(void) { mnCurrentOrder++; ClearVars(); } // add coordinates to mpPoints vector for all "Nav" orders in current order set void tcAIData::GetNavPoints(vector<tcPoint> *mpPoints) { int nSize = (int)maOrder.size(); for (int i=mnCurrentOrder;i<nSize;i++) { tcOrder order = maOrder[i]; if (order.mstrOrdername == "Nav") { tcPoint p; p.x = order.msDestination.mfLon_rad; p.y = order.msDestination.mfLat_rad; mpPoints->push_back(p); } } } UINT32 tcAIData::GetVar(int n) { if ((n < 0)||(n >= N_VAR)) { return 0xFFFFFFFF; // error out of range } else { return mnScriptVar[n]; } } void tcAIData::SetVar(int n, UINT32 val) { if ((n < 0)||(n >= N_VAR)) { return; // error out of range } else { mnScriptVar[n] = val; } } void tcAIData::Clear(void) { ClearOrders(); ClearVars(); mfNextUpdate = randf(4.0f); mfUpdateInterval = 4.0f; mzActionText = "-"; ClearTarget(); } /** * Clears script variables. */ void tcAIData::ClearVars() { for(int n=0;n<N_VAR;n++) { mnScriptVar[n] = 0; } } tcAIData::tcAIData(void) { Clear(); } tcAIData::~tcAIData(void) { } Index: SelfPreservation.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/ai/SelfPreservation.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SelfPreservation.cpp 16 Feb 2005 23:13:49 -0000 1.1 --- SelfPreservation.cpp 1 Jun 2005 00:13:28 -0000 1.2 *************** *** 34,38 **** using namespace ai; ! using ScriptInterface::tcPlatformInterface; --- 34,38 ---- using namespace ai; ! using scriptinterface::tcPlatformInterface; |