Changeset 8761 for code/branches/ai2/src
- Timestamp:
- Jul 15, 2011, 10:49:17 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai2/src/orxonox/controllers/ArtificialController.cc
r8758 r8761 33 33 34 34 #include "util/Math.h" 35 #include "util/Convert.h"36 35 #include "core/CoreIncludes.h" 37 36 #include "core/XMLPort.h" … … 49 48 #include "weaponsystem/WeaponPack.h" 50 49 #include "weaponsystem/Weapon.h" 51 50 #include "weaponsystem/WeaponSlot.h" 52 51 53 52 namespace orxonox … … 1137 1136 void ArtificialController::analyseWeapons(Pawn* pawn) 1138 1137 { 1139 int max =10, i=0, j=0, k=0;1138 int max = 10; 1140 1139 if(!pawn) return; 1141 while(i<max) 1142 { 1143 WeaponPack* wPack = pawn->getWeaponPack(i); //WeaponSet* wSet = pawn->getWeaponSet(i); 1144 i++; 1145 if(wPack==NULL) continue; 1146 while(j<max) 1147 { 1148 Weapon* wpn = wPack->getWeapon(j); 1149 j++; 1150 if(wpn==NULL) continue; 1151 while(k<max) 1152 { 1153 WeaponMode* wMode = wpn->getWeaponmode(k); 1154 k++; 1155 if(wMode==NULL) continue; 1156 COUT(0)<<wMode->getIdentifier()->getName()<<": weaponpack "+multi_cast<std::string>(i-1)<<", weapon "<<multi_cast<std::string>(j-1)<<", weaponmode "<<multi_cast<std::string>(k-1)<<std::endl; 1157 } 1140 for(int l=0; l<max ;l++) 1141 { 1142 WeaponSlot* wSlot = pawn->getWeaponSlot(l); 1143 if(wSlot==NULL) continue;//{COUT(0)<<"WEAPONSLOT "<<l<< " failed"<<endl; continue;} 1144 for(int i=0; i<max; i++) 1145 { 1146 WeaponMode* wMode = wSlot->getWeapon()->getWeaponmode(i); 1147 if(wMode==NULL) continue;//{COUT(0)<<"WEAPONMODE "<<i<< " failed"<<endl;} 1148 COUT(0)<<wMode->getIdentifier()->getName()<< " using mode:"<<i<<endl; 1158 1149 } 1159 1150 }
Note: See TracChangeset
for help on using the changeset viewer.