- Timestamp:
- May 3, 2019, 11:23:15 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS19/src/modules/pacman/PacmanBrown.cc
r12325 r12338 151 151 152 152 153 /*void PacmanBrown::findNeighboorPositions(Vector3 actuelposition, Vector3 adjacentPositions[], Vector3 positionArray[]){154 //this function should put in adjacentPosition[] the neighboors of lastPlayerPastPoint155 156 if(findpos(actuelposition,possibleposition[0])){157 158 159 adjacentPositions[0]=positionArray[1]; //graphVertex(possibleposition[1]); //need to do it everywhere !!!160 adjacentPositions[1]=positionArray[17]; //graphVertex(possibleposition[17]);161 adjacentPositions[2]=positionArray[19]; //graphVertex(possibleposition[19]); //maybe a vector would be more suitable ?162 }163 else if(findpos(actuelposition,possibleposition[1])){164 adjacentPositions[0]=positionArray[0]; //graphVertex(possibleposition[0]);165 adjacentPositions[1]=positionArray[2]; //graphVertex(possibleposition[2]);166 }167 else if(findpos(actuelposition,possibleposition[2])){168 adjacentPositions[0]=positionArray[1]; //graphVertex(possibleposition[1]);169 adjacentPositions[1]=positionArray[3]; //graphVertex(possibleposition[3]);170 }171 else if(findpos(actuelposition,possibleposition[3])){172 adjacentPositions[0]=positionArray[2]; //graphVertex(possibleposition[2]);173 adjacentPositions[1]=positionArray[4]; //graphVertex(possibleposition[4]);174 adjacentPositions[2]=positionArray[5]; //graphVertex(possibleposition[5]);175 }176 else if(findpos(actuelposition,possibleposition[4])){177 adjacentPositions[0]=positionArray[3]; //graphVertex(possibleposition[3]);178 adjacentPositions[1]=positionArray[6]; //graphVertex(possibleposition[6]);179 }180 else if(findpos(actuelposition,possibleposition[5])){181 adjacentPositions[0]=positionArray[3]; //graphVertex(possibleposition[3]);182 adjacentPositions[1]=positionArray[7]; //graphVertex(possibleposition[7]);183 }184 else if(findpos(actuelposition,possibleposition[6])){185 adjacentPositions[0]=positionArray[4]; //graphVertex(possibleposition[4]);186 adjacentPositions[1]=positionArray[9]; //graphVertex(possibleposition[9]);187 adjacentPositions[2]=positionArray[26]; //graphVertex(possibleposition[26]);188 }189 else if(findpos(actuelposition,possibleposition[7])){190 adjacentPositions[0]=positionArray[5]; //graphVertex(possibleposition[5]);191 adjacentPositions[1]=positionArray[8]; //graphVertex(possibleposition[8]);192 }193 else if(findpos(actuelposition,possibleposition[8])){194 adjacentPositions[0]=positionArray[7]; //graphVertex(possibleposition[7]);195 adjacentPositions[1]=positionArray[9]; //graphVertex(possibleposition[9]);196 }197 else if(findpos(actuelposition,possibleposition[9])){198 adjacentPositions[0]=positionArray[6]; //graphVertex(possibleposition[6]);199 adjacentPositions[1]=positionArray[8]; //graphVertex(possibleposition[8]);200 adjacentPositions[2]=positionArray[10]; //graphVertex(possibleposition[10]);201 adjacentPositions[3]=positionArray[38]; //graphVertex(possibleposition[38]);202 }203 else if(findpos(actuelposition,possibleposition[10])){204 adjacentPositions[0]=positionArray[9]; //graphVertex(possibleposition[9]);205 adjacentPositions[1]=positionArray[11]; //graphVertex(possibleposition[11]);206 adjacentPositions[2]=positionArray[45]; //graphVertex(possibleposition[45]);207 }208 else if(findpos(actuelposition,possibleposition[11])){209 adjacentPositions[0]=positionArray[10]; //graphVertex(possibleposition[10]);210 adjacentPositions[1]=positionArray[12]; //graphVertex(possibleposition[12]);211 adjacentPositions[2]=positionArray[13]; //graphVertex(possibleposition[13]);212 }213 else if(findpos(actuelposition,possibleposition[12])){214 adjacentPositions[0]=positionArray[11]; //graphVertex(possibleposition[11]);215 adjacentPositions[1]=positionArray[14]; //graphVertex(possibleposition[14]);216 }217 else if(findpos(actuelposition,possibleposition[13])){218 adjacentPositions[0]=positionArray[11]; //graphVertex(possibleposition[11]);219 adjacentPositions[1]=positionArray[14]; //graphVertex(possibleposition[14]);220 adjacentPositions[2]=positionArray[16]; //graphVertex(possibleposition[16]);221 adjacentPositions[3]=positionArray[61]; //graphVertex(possibleposition[61]);222 }223 else if(findpos(actuelposition,possibleposition[14])){224 adjacentPositions[0]=positionArray[12]; //graphVertex(possibleposition[12]);225 adjacentPositions[1]=positionArray[13]; //graphVertex(possibleposition[13]);226 adjacentPositions[2]=positionArray[15]; //graphVertex(possibleposition[15]);227 }228 else if(findpos(actuelposition,possibleposition[15])){229 adjacentPositions[0]=positionArray[14]; //graphVertex(possibleposition[14]);230 adjacentPositions[1]=positionArray[16]; //graphVertex(possibleposition[16]);231 }232 else if(findpos(actuelposition,possibleposition[16])){233 adjacentPositions[0]=positionArray[13]; //graphVertex(possibleposition[13]);234 adjacentPositions[1]=positionArray[15]; //graphVertex(possibleposition[15]);235 adjacentPositions[2]=positionArray[62]; //graphVertex(possibleposition[62]);236 }237 else if(findpos(actuelposition,possibleposition[17])){238 adjacentPositions[0]=positionArray[0]; //graphVertex(possibleposition[0]);239 adjacentPositions[1]=positionArray[25]; //graphVertex(possibleposition[25]);240 }241 else if(findpos(actuelposition,possibleposition[18])){242 adjacentPositions[0]=positionArray[19]; //graphVertex(possibleposition[19]);243 adjacentPositions[1]=positionArray[24]; //graphVertex(possibleposition[24]);244 }245 else if(findpos(actuelposition,possibleposition[19])){246 adjacentPositions[0]=positionArray[0]; //graphVertex(possibleposition[0]);247 adjacentPositions[1]=positionArray[18]; //graphVertex(possibleposition[18]);248 adjacentPositions[2]=positionArray[20]; //graphVertex(possibleposition[20]);249 }250 else if(findpos(actuelposition,possibleposition[20])){251 adjacentPositions[0]=positionArray[19]; //graphVertex(possibleposition[19]);252 adjacentPositions[1]=positionArray[21]; //graphVertex(possibleposition[21]);253 }254 else if(findpos(actuelposition,possibleposition[21])){255 adjacentPositions[0]=positionArray[20]; //graphVertex(possibleposition[20]);256 adjacentPositions[1]=positionArray[22]; //graphVertex(possibleposition[22]);257 }258 else if(findpos(actuelposition,possibleposition[22])){259 adjacentPositions[0]=positionArray[21]; //graphVertex(possibleposition[21]);260 adjacentPositions[1]=positionArray[23]; //graphVertex(possibleposition[23]);261 adjacentPositions[2]=positionArray[31]; //graphVertex(possibleposition[31]);262 }263 else if(findpos(actuelposition,possibleposition[23])){264 adjacentPositions[0]=positionArray[22]; //graphVertex(possibleposition[22]);265 adjacentPositions[1]=positionArray[30]; //graphVertex(possibleposition[30]);266 }267 else if(findpos(actuelposition,possibleposition[24])){268 adjacentPositions[0]=positionArray[18]; //graphVertex(possibleposition[18]);269 adjacentPositions[1]=positionArray[29]; //graphVertex(possibleposition[29]);270 }271 else if(findpos(actuelposition,possibleposition[25])){272 adjacentPositions[0]=positionArray[17]; //graphVertex(possibleposition[17]);273 adjacentPositions[1]=positionArray[26]; //graphVertex(possibleposition[26]);274 }275 else if(findpos(actuelposition,possibleposition[26])){276 adjacentPositions[0]=positionArray[6]; //graphVertex(possibleposition[6]);277 adjacentPositions[1]=positionArray[25]; //graphVertex(possibleposition[25]);278 adjacentPositions[2]=positionArray[27]; //graphVertex(possibleposition[27]);279 }280 else if(findpos(actuelposition,possibleposition[27])){281 adjacentPositions[0]=positionArray[26]; //graphVertex(possibleposition[26]);282 adjacentPositions[1]=positionArray[28]; //graphVertex(possibleposition[28]);283 adjacentPositions[2]=positionArray[37]; //graphVertex(possibleposition[37]);284 }285 else if(findpos(actuelposition,possibleposition[28])){286 adjacentPositions[0]=positionArray[27]; //graphVertex(possibleposition[27]);287 adjacentPositions[1]=positionArray[29]; //graphVertex(possibleposition[29]);288 adjacentPositions[2]=positionArray[36]; //graphVertex(possibleposition[36]);289 }290 else if(findpos(actuelposition,possibleposition[29])){291 adjacentPositions[0]=positionArray[24]; //graphVertex(possibleposition[24]);292 adjacentPositions[1]=positionArray[28]; //graphVertex(possibleposition[28]);293 adjacentPositions[2]=positionArray[30]; //graphVertex(possibleposition[30]);294 }295 else if(findpos(actuelposition,possibleposition[30])){296 adjacentPositions[0]=positionArray[23]; //graphVertex(possibleposition[23]);297 adjacentPositions[1]=positionArray[29]; //graphVertex(possibleposition[29]);298 adjacentPositions[2]=positionArray[34]; //graphVertex(possibleposition[34]);299 }300 else if(findpos(actuelposition,possibleposition[31])){301 adjacentPositions[0]=positionArray[22]; //graphVertex(possibleposition[22]);302 adjacentPositions[1]=positionArray[32]; //graphVertex(possibleposition[32]);303 }304 else if(findpos(actuelposition,possibleposition[32])){305 adjacentPositions[0]=positionArray[31]; //graphVertex(possibleposition[31]);306 adjacentPositions[1]=positionArray[33]; //graphVertex(possibleposition[33]);307 }308 else if(findpos(actuelposition,possibleposition[33])){309 adjacentPositions[0]=positionArray[32]; //graphVertex(possibleposition[32]);310 adjacentPositions[1]=positionArray[34]; //graphVertex(possibleposition[34]);311 }312 else if(findpos(actuelposition,possibleposition[34])){313 adjacentPositions[0]=positionArray[30]; //graphVertex(possibleposition[30]);314 adjacentPositions[1]=positionArray[33]; //graphVertex(possibleposition[33]);315 adjacentPositions[2]=positionArray[35]; //graphVertex(possibleposition[35]);316 adjacentPositions[3]=positionArray[42]; //graphVertex(possibleposition[42]);317 318 }319 else if(findpos(actuelposition,possibleposition[35])){320 adjacentPositions[0]=positionArray[34]; //graphVertex(possibleposition[34]);321 adjacentPositions[1]=positionArray[36]; //graphVertex(possibleposition[36]);322 adjacentPositions[2]=positionArray[41]; //graphVertex(possibleposition[41]);323 }324 else if(findpos(actuelposition,possibleposition[36])){325 adjacentPositions[0]=positionArray[28]; //graphVertex(possibleposition[28]);326 adjacentPositions[1]=positionArray[35]; //graphVertex(possibleposition[35]);327 }328 else if(findpos(actuelposition,possibleposition[37])){329 adjacentPositions[0]=positionArray[27]; //graphVertex(possibleposition[27]);330 adjacentPositions[1]=positionArray[38]; //graphVertex(possibleposition[38]);331 }332 else if(findpos(actuelposition,possibleposition[38])){333 adjacentPositions[0]=positionArray[9]; //graphVertex(possibleposition[9]);334 adjacentPositions[1]=positionArray[37]; //graphVertex(possibleposition[37]);335 adjacentPositions[2]=positionArray[39]; //graphVertex(possibleposition[39]);336 }337 else if(findpos(actuelposition,possibleposition[39])){338 adjacentPositions[0]=positionArray[38]; //graphVertex(possibleposition[38]);339 adjacentPositions[1]=positionArray[40]; //graphVertex(possibleposition[40]);340 adjacentPositions[2]=positionArray[45]; //graphVertex(possibleposition[45]);341 }342 else if(findpos(actuelposition,possibleposition[40])){343 adjacentPositions[0]=positionArray[39]; //graphVertex(possibleposition[39]);344 adjacentPositions[1]=positionArray[41]; //graphVertex(possibleposition[41]);345 }346 else if(findpos(actuelposition,possibleposition[41])){347 adjacentPositions[0]=positionArray[35]; //graphVertex(possibleposition[35]);348 adjacentPositions[1]=positionArray[43]; //graphVertex(possibleposition[43]);349 }350 else if(findpos(actuelposition,possibleposition[42])){351 adjacentPositions[0]=positionArray[34]; //graphVertex(possibleposition[34]);352 adjacentPositions[1]=positionArray[43]; //graphVertex(possibleposition[43]);353 adjacentPositions[2]=positionArray[54]; //graphVertex(possibleposition[54]);354 }355 else if(findpos(actuelposition,possibleposition[43])){356 adjacentPositions[0]=positionArray[41]; //graphVertex(possibleposition[41]);357 adjacentPositions[1]=positionArray[46]; //graphVertex(possibleposition[46]);358 }359 else if(findpos(actuelposition,possibleposition[44])){360 adjacentPositions[0]=positionArray[40]; //graphVertex(possibleposition[40]);361 adjacentPositions[1]=positionArray[66]; //graphVertex(possibleposition[66]);362 }363 else if(findpos(actuelposition,possibleposition[45])){364 adjacentPositions[0]=positionArray[10]; //graphVertex(possibleposition[10]);365 adjacentPositions[1]=positionArray[39]; //graphVertex(possibleposition[39]);366 adjacentPositions[2]=positionArray[49]; //graphVertex(possibleposition[49]);367 }368 else if(findpos(actuelposition,possibleposition[46])){369 adjacentPositions[0]=positionArray[43]; //graphVertex(possibleposition[43]);370 adjacentPositions[1]=positionArray[47]; //graphVertex(possibleposition[47]);371 }372 else if(findpos(actuelposition,possibleposition[47])){373 adjacentPositions[0]=positionArray[46]; //graphVertex(possibleposition[46]);374 adjacentPositions[1]=positionArray[52]; //graphVertex(possibleposition[52]);375 adjacentPositions[2]=positionArray[66]; //graphVertex(possibleposition[66]);376 }377 else if(findpos(actuelposition,possibleposition[48])){378 adjacentPositions[0]=positionArray[49]; //graphVertex(possibleposition[49]);379 adjacentPositions[1]=positionArray[51]; //graphVertex(possibleposition[51]);380 adjacentPositions[2]=positionArray[66]; //graphVertex(possibleposition[66]);381 }382 else if(findpos(actuelposition,possibleposition[49])){383 adjacentPositions[0]=positionArray[45]; //graphVertex(possibleposition[45]);384 adjacentPositions[1]=positionArray[48]; //graphVertex(possibleposition[48]);385 }386 else if(findpos(actuelposition,possibleposition[50])){387 adjacentPositions[0]=positionArray[51]; //graphVertex(possibleposition[51]);388 adjacentPositions[1]=positionArray[61]; //graphVertex(possibleposition[61]);389 }390 else if(findpos(actuelposition,possibleposition[51])){391 adjacentPositions[0]=positionArray[48]; //graphVertex(possibleposition[48]);392 adjacentPositions[1]=positionArray[50]; //graphVertex(possibleposition[50]);393 }394 else if(findpos(actuelposition,possibleposition[52])){395 adjacentPositions[0]=positionArray[47]; //graphVertex(possibleposition[47]);396 adjacentPositions[1]=positionArray[53]; //graphVertex(possibleposition[53]);397 }398 else if(findpos(actuelposition,possibleposition[53])){399 adjacentPositions[0]=positionArray[52]; //graphVertex(possibleposition[52]);400 adjacentPositions[1]=positionArray[58]; //graphVertex(possibleposition[58]);401 }402 else if(findpos(actuelposition,possibleposition[54])){403 adjacentPositions[0]=positionArray[42]; //graphVertex(possibleposition[42]);404 adjacentPositions[1]=positionArray[55]; //graphVertex(possibleposition[55]);405 adjacentPositions[2]=positionArray[57]; //graphVertex(possibleposition[57]);406 }407 else if(findpos(actuelposition,possibleposition[55])){408 adjacentPositions[0]=positionArray[54]; //graphVertex(possibleposition[54]);409 adjacentPositions[1]=positionArray[56]; //graphVertex(possibleposition[56]);410 }411 else if(findpos(actuelposition,possibleposition[56])){412 adjacentPositions[0]=positionArray[55]; //graphVertex(possibleposition[55]);413 adjacentPositions[1]=positionArray[57]; //graphVertex(possibleposition[57]);414 adjacentPositions[2]=positionArray[65]; //graphVertex(possibleposition[65]);415 }416 else if(findpos(actuelposition,possibleposition[57])){417 adjacentPositions[0]=positionArray[54]; //graphVertex(possibleposition[54]);418 adjacentPositions[1]=positionArray[56]; //graphVertex(possibleposition[56]);419 adjacentPositions[2]=positionArray[58]; //graphVertex(possibleposition[58]);420 adjacentPositions[3]=positionArray[64]; //graphVertex(possibleposition[64]);421 422 }423 else if(findpos(actuelposition,possibleposition[58])){424 adjacentPositions[0]=positionArray[53]; //graphVertex(possibleposition[53]);425 adjacentPositions[1]=positionArray[57]; //graphVertex(possibleposition[57]);426 adjacentPositions[2]=positionArray[59]; //graphVertex(possibleposition[59]);427 }428 else if(findpos(actuelposition,possibleposition[59])){429 adjacentPositions[0]=positionArray[58]; //graphVertex(possibleposition[58]);430 adjacentPositions[1]=positionArray[59]; //graphVertex(possibleposition[59]);431 adjacentPositions[2]=positionArray[63]; //graphVertex(possibleposition[63]);432 }433 else if(findpos(actuelposition,possibleposition[60])){434 adjacentPositions[0]=positionArray[59]; //graphVertex(possibleposition[59]);435 adjacentPositions[1]=positionArray[61]; //graphVertex(possibleposition[61]);436 adjacentPositions[2]=positionArray[62]; //graphVertex(possibleposition[62]);437 }438 else if(findpos(actuelposition,possibleposition[61])){439 adjacentPositions[0]=positionArray[13]; //graphVertex(possibleposition[13]);440 adjacentPositions[1]=positionArray[50]; //graphVertex(possibleposition[50]);441 adjacentPositions[2]=positionArray[60]; //graphVertex(possibleposition[60]);442 }443 else if(findpos(actuelposition,possibleposition[62])){444 adjacentPositions[0]=positionArray[16]; //graphVertex(possibleposition[16]);445 adjacentPositions[1]=positionArray[60]; //graphVertex(possibleposition[60]);446 }447 else if(findpos(actuelposition,possibleposition[63])){448 adjacentPositions[0]=positionArray[59]; //graphVertex(possibleposition[59]);449 adjacentPositions[1]=positionArray[64]; //graphVertex(possibleposition[64]);450 }451 else if(findpos(actuelposition,possibleposition[64])){452 adjacentPositions[0]=positionArray[57]; //graphVertex(possibleposition[57]);453 adjacentPositions[1]=positionArray[63]; //graphVertex(possibleposition[63]);454 adjacentPositions[2]=positionArray[65]; //graphVertex(possibleposition[65]);455 }456 else if(findpos(actuelposition,possibleposition[65])){457 adjacentPositions[0]=positionArray[56]; //graphVertex(possibleposition[56]);458 adjacentPositions[1]=positionArray[64]; //graphVertex(possibleposition[64]);459 }460 else if(findpos(actuelposition,possibleposition[66])){461 adjacentPositions[0]=positionArray[47]; //graphVertex(possibleposition[47]);462 adjacentPositions[1]=positionArray[48]; //graphVertex(possibleposition[48]);463 }464 }*/465 466 467 468 153 } 469 154
Note: See TracChangeset
for help on using the changeset viewer.