Changeset 11071 for code/trunk/src/modules/jump
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/modules/jump/Jump.cc
r10262 r11071 34 34 #include "Jump.h" 35 35 #include "core/CoreIncludes.h" 36 #include "core/EventIncludes.h" 37 #include "core/command/Executor.h" 38 #include "core/config/ConfigValueIncludes.h" 39 #include "gamestates/GSLevel.h" 40 #include "chat/ChatManager.h" 36 41 37 #include "JumpCenterpoint.h" 42 38 #include "JumpPlatform.h" … … 56 52 #include "JumpBoots.h" 57 53 #include "JumpShield.h" 54 55 #include "gamestates/GSLevel.h" 58 56 #include "infos/PlayerInfo.h" 57 #include "graphics/Camera.h" 59 58 60 59 namespace orxonox … … 66 65 RegisterObject(Jump); 67 66 68 center_ = 0;69 figure_ = 0;70 camera = 0;67 center_ = nullptr; 68 figure_ = nullptr; 69 camera = nullptr; 71 70 setHUDTemplate("JumpHUD"); 72 73 setConfigValues();74 71 } 75 72 … … 86 83 SUPER(Jump, tick, dt); 87 84 88 if (figure_ != NULL)85 if (figure_ != nullptr) 89 86 { 90 87 Vector3 figurePosition = figure_->getPosition(); … … 101 98 if (screenShiftSinceLastUpdate_ > center_->getSectionLength()) 102 99 { 103 if (sectionNumber_ > 2 && sectionNumber_%4 == 0 && rand()%2 == 0 && figure_->propellerActive_ == false && figure_->rocketActive_ == false&& addAdventure(adventureNumber_) == true)100 if (sectionNumber_ > 2 && sectionNumber_%4 == 0 && rand()%2 == 0 && figure_->propellerActive_ == nullptr && figure_->rocketActive_ == nullptr && addAdventure(adventureNumber_) == true) 104 101 { 105 102 screenShiftSinceLastUpdate_ -= 2*center_->getSectionLength(); … … 133 130 134 131 135 if (camera != NULL)132 if (camera != nullptr) 136 133 { 137 134 Vector3 cameraPosition = Vector3(0, totalScreenShift_, 0); … … 144 141 } 145 142 146 ObjectList<JumpPlatform>::iterator beginPlatform = ObjectList<JumpPlatform>::begin(); 147 ObjectList<JumpPlatform>::iterator endPlatform = ObjectList<JumpPlatform>::end(); 148 ObjectList<JumpPlatform>::iterator itPlatform = beginPlatform; 143 ObjectList<JumpPlatform> listPlatform; 144 ObjectList<JumpPlatform>::iterator itPlatform = listPlatform.begin(); 149 145 Vector3 platformPosition; 150 146 151 while (itPlatform != endPlatform)147 while (itPlatform != listPlatform.end()) 152 148 { 153 149 platformPosition = itPlatform->getPosition(); … … 166 162 167 163 // Deleted deactivated platforms 168 ObjectList<JumpPlatformDisappear>::iterator beginDisappear = ObjectList<JumpPlatformDisappear>::begin(); 169 ObjectList<JumpPlatformDisappear>::iterator endDisappear = ObjectList<JumpPlatformDisappear>::end(); 170 ObjectList<JumpPlatformDisappear>::iterator itDisappear = beginDisappear; 171 172 while (itDisappear != endDisappear) 164 ObjectList<JumpPlatformDisappear> listDisappear; 165 ObjectList<JumpPlatformDisappear>::iterator itDisappear = listDisappear.begin(); 166 167 while (itDisappear != listDisappear.end()) 173 168 { 174 169 if (!itDisappear->isActive()) … … 185 180 } 186 181 187 ObjectList<JumpPlatformTimer>::iterator beginTimer = ObjectList<JumpPlatformTimer>::begin(); 188 ObjectList<JumpPlatformTimer>::iterator endTimer = ObjectList<JumpPlatformTimer>::end(); 189 ObjectList<JumpPlatformTimer>::iterator itTimer = beginTimer; 190 191 while (itTimer != endTimer) 182 ObjectList<JumpPlatformTimer> listTimer; 183 ObjectList<JumpPlatformTimer>::iterator itTimer = listTimer.begin(); 184 185 while (itTimer != listTimer.end()) 192 186 { 193 187 if (!itTimer->isActive()) … … 204 198 } 205 199 206 ObjectList<JumpProjectile>::iterator beginProjectile = ObjectList<JumpProjectile>::begin(); 207 ObjectList<JumpProjectile>::iterator endProjectile = ObjectList<JumpProjectile>::end(); 208 ObjectList<JumpProjectile>::iterator itProjectile = beginProjectile; 200 ObjectList<JumpProjectile> listProjectile; 201 ObjectList<JumpProjectile>::iterator itProjectile = listProjectile.begin(); 209 202 Vector3 projectilePosition; 210 203 211 while (itProjectile != endProjectile)204 while (itProjectile != listProjectile.end()) 212 205 { 213 206 projectilePosition = itProjectile->getPosition(); … … 225 218 } 226 219 227 ObjectList<JumpEnemy>::iterator beginEnemy = ObjectList<JumpEnemy>::begin(); 228 ObjectList<JumpEnemy>::iterator endEnemy = ObjectList<JumpEnemy>::end(); 229 ObjectList<JumpEnemy>::iterator itEnemy = beginEnemy; 220 ObjectList<JumpEnemy> listEnemy; 221 ObjectList<JumpEnemy>::iterator itEnemy = listEnemy.begin(); 230 222 Vector3 enemyPosition; 231 223 232 while (itEnemy != endEnemy)224 while (itEnemy != listEnemy.end()) 233 225 { 234 226 enemyPosition = itEnemy->getPosition(); … … 246 238 } 247 239 248 ObjectList<JumpItem>::iterator beginItem = ObjectList<JumpItem>::begin(); 249 ObjectList<JumpItem>::iterator endItem = ObjectList<JumpItem>::end(); 250 ObjectList<JumpItem>::iterator itItem = beginItem; 240 ObjectList<JumpItem> listItem; 241 ObjectList<JumpItem>::iterator itItem = listItem.begin(); 251 242 Vector3 itemPosition; 252 243 253 while (itItem != endItem)244 while (itItem != listItem.end()) 254 245 { 255 246 itemPosition = itItem->getPosition(); … … 273 264 void Jump::cleanup() 274 265 { 275 camera = 0;266 camera = nullptr; 276 267 } 277 268 278 269 void Jump::start() 279 270 { 280 if (center_ != NULL) // There needs to be a JumpCenterpoint, i.e. the area the game takes place.281 { 282 if (figure_ == NULL)271 if (center_ != nullptr) // There needs to be a JumpCenterpoint, i.e. the area the game takes place. 272 { 273 if (figure_ == nullptr) 283 274 { 284 275 figure_ = new JumpFigure(center_->getContext()); … … 301 292 Deathmatch::start(); 302 293 303 if (figure_ != NULL)294 if (figure_ != nullptr) 304 295 { 305 296 camera = figure_->getCamera(); … … 328 319 assert(player); 329 320 330 if (figure_->getPlayer() == NULL)321 if (figure_->getPlayer() == nullptr) 331 322 { 332 323 player->startControl(figure_); … … 337 328 PlayerInfo* Jump::getPlayer() const 338 329 { 339 if (this->figure_ != NULL)330 if (this->figure_ != nullptr) 340 331 { 341 332 return this->figure_->getPlayer(); … … 343 334 else 344 335 { 345 return 0;336 return nullptr; 346 337 } 347 338 } … … 349 340 void Jump::addPlatform(JumpPlatform* newPlatform, std::string platformTemplate, float xPosition, float zPosition) 350 341 { 351 if (newPlatform != NULL && center_ != NULL)342 if (newPlatform != nullptr && center_ != nullptr) 352 343 { 353 344 newPlatform->addTemplate(platformTemplate); … … 417 408 { 418 409 JumpProjectile* newProjectile = new JumpProjectile(center_->getContext()); 419 if (newProjectile != NULL && center_ != NULL)410 if (newProjectile != nullptr && center_ != nullptr) 420 411 { 421 412 newProjectile->addTemplate(center_->getProjectileTemplate()); … … 430 421 { 431 422 JumpSpring* newSpring = new JumpSpring(center_->getContext()); 432 if (newSpring != NULL && center_ != NULL)423 if (newSpring != nullptr && center_ != nullptr) 433 424 { 434 425 newSpring->addTemplate(center_->getSpringTemplate()); … … 443 434 { 444 435 JumpSpring* newSpring = new JumpSpring(center_->getContext()); 445 if (newSpring != NULL && center_ != NULL)436 if (newSpring != nullptr && center_ != nullptr) 446 437 { 447 438 newSpring->addTemplate(center_->getSpringTemplate()); … … 456 447 { 457 448 JumpRocket* newRocket = new JumpRocket(center_->getContext()); 458 if (newRocket != NULL && center_ != NULL)449 if (newRocket != nullptr && center_ != nullptr) 459 450 { 460 451 newRocket->addTemplate(center_->getRocketTemplate()); … … 469 460 { 470 461 JumpRocket* newRocket = new JumpRocket(center_->getContext()); 471 if (newRocket != NULL && center_ != NULL)462 if (newRocket != nullptr && center_ != nullptr) 472 463 { 473 464 newRocket->addTemplate(center_->getRocketTemplate()); … … 482 473 { 483 474 JumpPropeller* newPropeller = new JumpPropeller(center_->getContext()); 484 if (newPropeller != NULL && center_ != NULL)475 if (newPropeller != nullptr && center_ != nullptr) 485 476 { 486 477 newPropeller->addTemplate(center_->getPropellerTemplate()); … … 495 486 { 496 487 JumpPropeller* newPropeller = new JumpPropeller(center_->getContext()); 497 if (newPropeller != NULL && center_ != NULL)488 if (newPropeller != nullptr && center_ != nullptr) 498 489 { 499 490 newPropeller->addTemplate(center_->getPropellerTemplate()); … … 508 499 { 509 500 JumpBoots* newBoots = new JumpBoots(center_->getContext()); 510 if (newBoots != NULL && center_ != NULL)501 if (newBoots != nullptr && center_ != nullptr) 511 502 { 512 503 newBoots->addTemplate(center_->getBootsTemplate()); … … 521 512 { 522 513 JumpBoots* newBoots = new JumpBoots(center_->getContext()); 523 if (newBoots != NULL && center_ != NULL)514 if (newBoots != nullptr && center_ != nullptr) 524 515 { 525 516 newBoots->addTemplate(center_->getBootsTemplate()); … … 534 525 { 535 526 JumpShield* newShield = new JumpShield(center_->getContext()); 536 if (newShield != NULL && center_ != NULL)527 if (newShield != nullptr && center_ != nullptr) 537 528 { 538 529 newShield->addTemplate(center_->getShieldTemplate()); … … 547 538 { 548 539 JumpShield* newShield = new JumpShield(center_->getContext()); 549 if (newShield != NULL && center_ != NULL)540 if (newShield != nullptr && center_ != nullptr) 550 541 { 551 542 newShield->addTemplate(center_->getShieldTemplate()); … … 560 551 { 561 552 JumpEnemy* newEnemy = new JumpEnemy(center_->getContext()); 562 if (newEnemy != NULL && center_ != NULL)553 if (newEnemy != nullptr && center_ != nullptr) 563 554 { 564 555 switch (type) … … 619 610 const int numJ = 4; 620 611 621 enum PlatformType622 { 623 PLATFORM_EMPTY, PLATFORM_STATIC, PLATFORM_HMOVE, PLATFORM_VMOVE, PLATFORM_DISAPPEAR, PLATFORM_TIMER, PLATFORM_FAKE612 enum class PlatformType 613 { 614 EMPTY, STATIC, HMOVE, VMOVE, DISAPPEAR, TIMER, FAKE 624 615 }; 625 616 626 enum ItemType627 { 628 ITEM_NOTHING, ITEM_SPRING, ITEM_PROPELLER, ITEM_ROCKET, ITEM_BOOTS, ITEM_SHIELD617 enum class ItemType 618 { 619 NOTHING, SPRING, PROPELLER, ROCKET, BOOTS, SHIELD 629 620 }; 630 621 … … 640 631 for (int j = 0; j < numJ; ++j) 641 632 { 642 matrix[i][j].type = P LATFORM_EMPTY;633 matrix[i][j].type = PlatformType::EMPTY; 643 634 matrix[i][j].done = false; 644 635 } … … 646 637 PlatformType platformtype1; 647 638 PlatformType platformtype2; 648 ItemType itemType = I TEM_NOTHING;639 ItemType itemType = ItemType::NOTHING; 649 640 650 641 if (rand()%2 == 0) 651 642 { 652 itemType = I TEM_SPRING;643 itemType = ItemType::SPRING; 653 644 } 654 645 else if (rand()%2 == 0 && sectionNumber_ > 3) … … 657 648 { 658 649 case 0: 659 itemType = I TEM_PROPELLER;650 itemType = ItemType::PROPELLER; 660 651 break; 661 652 case 1: 662 itemType = I TEM_ROCKET;653 itemType = ItemType::ROCKET; 663 654 break; 664 655 case 2: 665 itemType = I TEM_BOOTS;656 itemType = ItemType::BOOTS; 666 657 break; 667 658 case 3: 668 itemType = I TEM_SHIELD;659 itemType = ItemType::SHIELD; 669 660 break; 670 661 default: … … 676 667 { 677 668 case 0: 678 platformtype1 = P LATFORM_STATIC;679 platformtype2 = P LATFORM_STATIC;669 platformtype1 = PlatformType::STATIC; 670 platformtype2 = PlatformType::STATIC; 680 671 break; 681 672 case 1: 682 platformtype1 = P LATFORM_STATIC;683 platformtype2 = P LATFORM_STATIC;673 platformtype1 = PlatformType::STATIC; 674 platformtype2 = PlatformType::STATIC; 684 675 break; 685 676 case 2: 686 platformtype1 = P LATFORM_STATIC;687 platformtype2 = P LATFORM_HMOVE;677 platformtype1 = PlatformType::STATIC; 678 platformtype2 = PlatformType::HMOVE; 688 679 break; 689 680 case 3: 690 platformtype1 = P LATFORM_STATIC;691 platformtype2 = P LATFORM_DISAPPEAR;681 platformtype1 = PlatformType::STATIC; 682 platformtype2 = PlatformType::DISAPPEAR; 692 683 break; 693 684 case 4: 694 platformtype1 = P LATFORM_STATIC;695 platformtype2 = P LATFORM_VMOVE;685 platformtype1 = PlatformType::STATIC; 686 platformtype2 = PlatformType::VMOVE; 696 687 break; 697 688 case 5: 698 platformtype1 = P LATFORM_STATIC;699 platformtype2 = P LATFORM_TIMER;689 platformtype1 = PlatformType::STATIC; 690 platformtype2 = PlatformType::TIMER; 700 691 break; 701 692 case 6: 702 platformtype1 = P LATFORM_HMOVE;703 platformtype2 = P LATFORM_STATIC;693 platformtype1 = PlatformType::HMOVE; 694 platformtype2 = PlatformType::STATIC; 704 695 break; 705 696 case 7: 706 platformtype1 = P LATFORM_HMOVE;707 platformtype2 = P LATFORM_HMOVE;697 platformtype1 = PlatformType::HMOVE; 698 platformtype2 = PlatformType::HMOVE; 708 699 break; 709 700 case 8: 710 platformtype1 = P LATFORM_HMOVE;711 platformtype2 = P LATFORM_HMOVE;701 platformtype1 = PlatformType::HMOVE; 702 platformtype2 = PlatformType::HMOVE; 712 703 break; 713 704 case 9: 714 platformtype1 = P LATFORM_HMOVE;715 platformtype2 = P LATFORM_DISAPPEAR;705 platformtype1 = PlatformType::HMOVE; 706 platformtype2 = PlatformType::DISAPPEAR; 716 707 break; 717 708 case 10: 718 platformtype1 = P LATFORM_HMOVE;719 platformtype2 = P LATFORM_VMOVE;709 platformtype1 = PlatformType::HMOVE; 710 platformtype2 = PlatformType::VMOVE; 720 711 break; 721 712 case 11: 722 platformtype1 = P LATFORM_HMOVE;723 platformtype2 = P LATFORM_TIMER;713 platformtype1 = PlatformType::HMOVE; 714 platformtype2 = PlatformType::TIMER; 724 715 break; 725 716 case 12: 726 platformtype1 = P LATFORM_DISAPPEAR;727 platformtype2 = P LATFORM_STATIC;717 platformtype1 = PlatformType::DISAPPEAR; 718 platformtype2 = PlatformType::STATIC; 728 719 break; 729 720 case 13: 730 platformtype1 = P LATFORM_DISAPPEAR;731 platformtype2 = P LATFORM_HMOVE;721 platformtype1 = PlatformType::DISAPPEAR; 722 platformtype2 = PlatformType::HMOVE; 732 723 break; 733 724 case 14: 734 platformtype1 = P LATFORM_DISAPPEAR;735 platformtype2 = P LATFORM_DISAPPEAR;725 platformtype1 = PlatformType::DISAPPEAR; 726 platformtype2 = PlatformType::DISAPPEAR; 736 727 break; 737 728 case 15: 738 platformtype1 = P LATFORM_DISAPPEAR;739 platformtype2 = P LATFORM_DISAPPEAR;729 platformtype1 = PlatformType::DISAPPEAR; 730 platformtype2 = PlatformType::DISAPPEAR; 740 731 break; 741 732 case 16: 742 platformtype1 = P LATFORM_DISAPPEAR;743 platformtype2 = P LATFORM_VMOVE;733 platformtype1 = PlatformType::DISAPPEAR; 734 platformtype2 = PlatformType::VMOVE; 744 735 break; 745 736 case 17: 746 platformtype1 = P LATFORM_DISAPPEAR;747 platformtype2 = P LATFORM_TIMER;737 platformtype1 = PlatformType::DISAPPEAR; 738 platformtype2 = PlatformType::TIMER; 748 739 break; 749 740 case 18: 750 platformtype1 = P LATFORM_VMOVE;751 platformtype2 = P LATFORM_STATIC;741 platformtype1 = PlatformType::VMOVE; 742 platformtype2 = PlatformType::STATIC; 752 743 break; 753 744 case 19: 754 platformtype1 = P LATFORM_VMOVE;755 platformtype2 = P LATFORM_HMOVE;745 platformtype1 = PlatformType::VMOVE; 746 platformtype2 = PlatformType::HMOVE; 756 747 break; 757 748 case 20: 758 platformtype1 = P LATFORM_VMOVE;759 platformtype2 = P LATFORM_DISAPPEAR;749 platformtype1 = PlatformType::VMOVE; 750 platformtype2 = PlatformType::DISAPPEAR; 760 751 break; 761 752 case 21: 762 platformtype1 = P LATFORM_VMOVE;763 platformtype2 = P LATFORM_VMOVE;753 platformtype1 = PlatformType::VMOVE; 754 platformtype2 = PlatformType::VMOVE; 764 755 break; 765 756 case 22: 766 platformtype1 = P LATFORM_VMOVE;767 platformtype2 = P LATFORM_VMOVE;757 platformtype1 = PlatformType::VMOVE; 758 platformtype2 = PlatformType::VMOVE; 768 759 break; 769 760 case 23: 770 platformtype1 = P LATFORM_VMOVE;771 platformtype2 = P LATFORM_TIMER;761 platformtype1 = PlatformType::VMOVE; 762 platformtype2 = PlatformType::TIMER; 772 763 break; 773 764 case 24: 774 platformtype1 = P LATFORM_TIMER;775 platformtype2 = P LATFORM_STATIC;765 platformtype1 = PlatformType::TIMER; 766 platformtype2 = PlatformType::STATIC; 776 767 break; 777 768 case 25: 778 platformtype1 = P LATFORM_TIMER;779 platformtype2 = P LATFORM_HMOVE;769 platformtype1 = PlatformType::TIMER; 770 platformtype2 = PlatformType::HMOVE; 780 771 break; 781 772 case 26: 782 platformtype1 = P LATFORM_TIMER;783 platformtype2 = P LATFORM_DISAPPEAR;773 platformtype1 = PlatformType::TIMER; 774 platformtype2 = PlatformType::DISAPPEAR; 784 775 break; 785 776 case 27: 786 platformtype1 = P LATFORM_TIMER;787 platformtype2 = P LATFORM_VMOVE;777 platformtype1 = PlatformType::TIMER; 778 platformtype2 = PlatformType::VMOVE; 788 779 break; 789 780 case 28: 790 platformtype1 = P LATFORM_TIMER;791 platformtype2 = P LATFORM_TIMER;781 platformtype1 = PlatformType::TIMER; 782 platformtype2 = PlatformType::TIMER; 792 783 break; 793 784 default: 794 platformtype1 = P LATFORM_TIMER;795 platformtype2 = P LATFORM_TIMER;785 platformtype1 = PlatformType::TIMER; 786 platformtype2 = PlatformType::TIMER; 796 787 break; 797 788 } … … 816 807 if (platformtype1 == platformtype2 && sectionNumber_ > 10 && rand()%2 == 0) 817 808 { 818 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;819 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;809 matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY; 810 matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY; 820 811 } 821 812 … … 825 816 if (rand()%2 == 0) 826 817 { 827 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;828 } 829 else 830 { 831 matrix[rand()%numI][rand()%numJ].type = P LATFORM_FAKE;818 matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY; 819 } 820 else 821 { 822 matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE; 832 823 } 833 824 } … … 836 827 if (rand()%2 == 0) 837 828 { 838 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;839 } 840 else 841 { 842 matrix[rand()%numI][rand()%numJ].type = P LATFORM_FAKE;829 matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY; 830 } 831 else 832 { 833 matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE; 843 834 } 844 835 if (rand()%2 == 0) 845 836 { 846 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;847 } 848 else 849 { 850 matrix[rand()%numI][rand()%numJ].type = P LATFORM_FAKE;837 matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY; 838 } 839 else 840 { 841 matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE; 851 842 } 852 843 } … … 855 846 if (rand()%2 == 0) 856 847 { 857 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;858 } 859 else 860 { 861 matrix[rand()%numI][rand()%numJ].type = P LATFORM_FAKE;848 matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY; 849 } 850 else 851 { 852 matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE; 862 853 } 863 854 if (rand()%2 == 0) 864 855 { 865 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;866 } 867 else 868 { 869 matrix[rand()%numI][rand()%numJ].type = P LATFORM_FAKE;856 matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY; 857 } 858 else 859 { 860 matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE; 870 861 } 871 862 if (rand()%2 == 0) 872 863 { 873 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;874 } 875 else 876 { 877 matrix[rand()%numI][rand()%numJ].type = P LATFORM_FAKE;864 matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY; 865 } 866 else 867 { 868 matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE; 878 869 } 879 870 } … … 898 889 switch(matrix[i][j].type) 899 890 { 900 case P LATFORM_EMPTY:891 case PlatformType::EMPTY: 901 892 matrix[i][j].done = true; 902 893 break; 903 case P LATFORM_STATIC:894 case PlatformType::STATIC: 904 895 xPosition = randomXPosition(numJ, j); 905 896 zPosition = sectionBegin + i*sectionLength/numI; … … 907 898 matrix[i][j].done = true; 908 899 break; 909 case P LATFORM_FAKE:900 case PlatformType::FAKE: 910 901 xPosition = randomXPosition(numJ, j); 911 902 zPosition = sectionBegin + i*sectionLength/numI; … … 913 904 matrix[i][j].done = true; 914 905 break; 915 case P LATFORM_TIMER:906 case PlatformType::TIMER: 916 907 xPosition = randomXPosition(numJ, j); 917 908 zPosition = sectionBegin + i*sectionLength/numI; … … 919 910 matrix[i][j].done = true; 920 911 break; 921 case P LATFORM_DISAPPEAR:912 case PlatformType::DISAPPEAR: 922 913 xPosition = randomXPosition(numJ, j); 923 914 zPosition = sectionBegin + i*sectionLength/numI; … … 925 916 matrix[i][j].done = true; 926 917 break; 927 case P LATFORM_HMOVE:918 case PlatformType::HMOVE: 928 919 xVelocity = randomSpeed(); 929 if (j <= numJ-3 && matrix[i][j+1].type == P LATFORM_HMOVE && matrix[i][j+2].type == PLATFORM_HMOVE && rand()%2 == 0)920 if (j <= numJ-3 && matrix[i][j+1].type == PlatformType::HMOVE && matrix[i][j+2].type == PlatformType::HMOVE && rand()%2 == 0) 930 921 { 931 922 leftBoundary = randomXPositionLeft(numJ, j); … … 938 929 matrix[i][j+2].done = true; 939 930 } 940 else if (j <= numJ-2 && matrix[i][j+1].type == P LATFORM_HMOVE && rand()%2 == 0)931 else if (j <= numJ-2 && matrix[i][j+1].type == PlatformType::HMOVE && rand()%2 == 0) 941 932 { 942 933 leftBoundary = randomXPositionLeft(numJ, j); … … 958 949 } 959 950 break; 960 case P LATFORM_VMOVE:951 case PlatformType::VMOVE: 961 952 zVelocity = randomSpeed(); 962 if (i <= numI-3 && matrix[i+1][j].type == P LATFORM_VMOVE && matrix[i+2][j].type == PLATFORM_VMOVE && rand()%2 == 0)953 if (i <= numI-3 && matrix[i+1][j].type == PlatformType::VMOVE && matrix[i+2][j].type == PlatformType::VMOVE && rand()%2 == 0) 963 954 { 964 955 lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd); … … 971 962 matrix[i+2][j].done = true; 972 963 } 973 else if (i <= numI-2 && matrix[i+1][j].type == P LATFORM_VMOVE && rand()%2 == 0)964 else if (i <= numI-2 && matrix[i+1][j].type == PlatformType::VMOVE && rand()%2 == 0) 974 965 { 975 966 lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd); … … 1009 1000 switch (itemType) 1010 1001 { 1011 case I TEM_ROCKET:1002 case ItemType::ROCKET: 1012 1003 addRocket(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0); 1013 1004 break; 1014 case I TEM_PROPELLER:1005 case ItemType::PROPELLER: 1015 1006 addPropeller(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0); 1016 1007 break; 1017 case I TEM_BOOTS:1008 case ItemType::BOOTS: 1018 1009 addBoots(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0); 1019 1010 break; 1020 case I TEM_SHIELD:1011 case ItemType::SHIELD: 1021 1012 addShield(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0); 1022 1013 break; … … 1029 1020 switch (itemType) 1030 1021 { 1031 case I TEM_ROCKET:1022 case ItemType::ROCKET: 1032 1023 addRocket(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed()); 1033 1024 break; 1034 case I TEM_PROPELLER:1025 case ItemType::PROPELLER: 1035 1026 addPropeller(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed()); 1036 1027 break; 1037 case I TEM_BOOTS:1028 case ItemType::BOOTS: 1038 1029 addBoots(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed()); 1039 1030 break; 1040 case I TEM_SHIELD:1031 case ItemType::SHIELD: 1041 1032 addShield(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed()); 1042 1033 break; … … 1054 1045 switch (itemType) 1055 1046 { 1056 case I TEM_SPRING:1047 case ItemType::SPRING: 1057 1048 addSpring(itemPlatform); 1058 1049 break; 1059 case I TEM_ROCKET:1050 case ItemType::ROCKET: 1060 1051 addRocket(itemPlatform); 1061 1052 break; 1062 case I TEM_PROPELLER:1053 case ItemType::PROPELLER: 1063 1054 addPropeller(itemPlatform); 1064 1055 break; 1065 case I TEM_BOOTS:1056 case ItemType::BOOTS: 1066 1057 addBoots(itemPlatform); 1067 1058 break; 1068 case I TEM_SHIELD:1059 case ItemType::SHIELD: 1069 1060 addShield(itemPlatform); 1070 1061 break; … … 1273 1264 float Jump::getFuel() const 1274 1265 { 1275 if (this->figure_ != NULL)1276 { 1277 if (this->figure_->rocketActive_ != NULL)1266 if (this->figure_ != nullptr) 1267 { 1268 if (this->figure_->rocketActive_ != nullptr) 1278 1269 { 1279 1270 return this->figure_->rocketActive_->getFuelState(); 1280 1271 } 1281 else if (this->figure_->propellerActive_ != NULL)1272 else if (this->figure_->propellerActive_ != nullptr) 1282 1273 { 1283 1274 return this->figure_->propellerActive_->getFuelState(); 1284 1275 } 1285 else if (this->figure_->shieldActive_ != NULL)1276 else if (this->figure_->shieldActive_ != nullptr) 1286 1277 { 1287 1278 return this->figure_->shieldActive_->getFuelState(); 1288 1279 } 1289 else if (this->figure_->bootsActive_ != NULL)1280 else if (this->figure_->bootsActive_ != nullptr) 1290 1281 { 1291 1282 return this->figure_->bootsActive_->getFuelState(); … … 1300 1291 return figure_->dead_; 1301 1292 } 1293 1294 void Jump::setCenterpoint(JumpCenterpoint* center) 1295 { 1296 center_ = center; 1297 } 1298 1302 1299 } -
code/trunk/src/modules/jump/Jump.h
r10262 r11071 31 31 32 32 #include "jump/JumpPrereqs.h" 33 #include "tools/Timer.h"34 #include "graphics/Camera.h"35 33 #include "gametypes/Deathmatch.h" 36 #include "JumpCenterpoint.h"37 #include <list>38 34 39 35 namespace orxonox … … 44 40 Jump(Context* context); 45 41 virtual ~Jump(); 46 virtual void tick(float dt) ;47 virtual void start() ;48 virtual void end() ;49 virtual void spawnPlayer(PlayerInfo* player) ;42 virtual void tick(float dt) override; 43 virtual void start() override; 44 virtual void end() override; 45 virtual void spawnPlayer(PlayerInfo* player) override; 50 46 int getScore(PlayerInfo* player) const; 51 47 float getFuel() const; 52 48 bool getDead(PlayerInfo* player) const; 53 void setCenterpoint(JumpCenterpoint* center) 54 { center_ = center; } 49 void setCenterpoint(JumpCenterpoint* center); 55 50 PlayerInfo* getPlayer() const; 56 51 -
code/trunk/src/modules/jump/JumpBoots.cc
r10262 r11071 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h"38 #include "graphics/Model.h"39 #include "gametypes/Gametype.h"40 41 37 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 38 46 39 namespace orxonox … … 67 60 } 68 61 69 void JumpBoots::XMLPort(Element& xmlelement, XMLPort::Mode mode)70 {71 SUPER(JumpBoots, XMLPort, xmlelement, mode);72 }73 74 62 void JumpBoots::tick(float dt) 75 63 { … … 78 66 Vector3 rocketPosition = getWorldPosition(); 79 67 80 if (attachedToFigure_ == false && figure_ != NULL)68 if (attachedToFigure_ == false && figure_ != nullptr) 81 69 { 82 70 Vector3 figurePosition = figure_->getWorldPosition(); -
code/trunk/src/modules/jump/JumpBoots.h
r10262 r11071 30 30 #define _JumpBoots_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 #include "util/Math.h" 34 #include "worldentities/MovableEntity.h" 35 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 36 34 37 35 namespace orxonox … … 42 40 JumpBoots(Context* context); 43 41 virtual ~JumpBoots(); 44 virtual void tick(float dt); 45 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 46 virtual void touchFigure(); 42 virtual void tick(float dt) override; 43 virtual void touchFigure() override; 47 44 virtual float getFuelState(); 48 45 protected: -
code/trunk/src/modules/jump/JumpCenterpoint.cc
r10624 r11071 33 33 34 34 #include "JumpCenterpoint.h" 35 35 36 #include "core/CoreIncludes.h" 36 37 #include "core/XMLPort.h" … … 82 83 void JumpCenterpoint::checkGametype() 83 84 { 84 if (getGametype() != NULL&& this->getGametype()->isA(Class(Jump)))85 if (getGametype() != nullptr && this->getGametype()->isA(Class(Jump))) 85 86 { 86 87 Jump* jumpGametype = orxonox_cast<Jump*>(this->getGametype()); -
code/trunk/src/modules/jump/JumpCenterpoint.h
r10624 r11071 31 31 32 32 #include "jump/JumpPrereqs.h" 33 34 #include <string>35 36 #include <util/Math.h>37 38 33 #include "worldentities/StaticEntity.h" 39 34 … … 113 108 JumpCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Jump. 114 109 virtual ~JumpCenterpoint() {} 115 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ; //!< Method to create a JumpCenterpoint through XML.110 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; //!< Method to create a JumpCenterpoint through XML. 116 111 void setPlatformStaticTemplate(const std::string& balltemplate) 117 112 { this->platformStaticTemplate_ = balltemplate; } -
code/trunk/src/modules/jump/JumpEnemy.cc
r10624 r11071 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 37 #include "core/XMLPort.h" 41 38 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 39 46 40 namespace orxonox … … 57 51 58 52 dead_ = false; 59 figure_ = 0;53 figure_ = nullptr; 60 54 width_ = 0.0; 61 55 height_ = 0.0; … … 125 119 Vector3 enemyPosition = getPosition(); 126 120 127 if (figure_ != NULL)121 if (figure_ != nullptr) 128 122 { 129 123 Vector3 figurePosition = figure_->getPosition(); -
code/trunk/src/modules/jump/JumpEnemy.h
r10624 r11071 37 37 38 38 #include "jump/JumpPrereqs.h" 39 40 #include "util/Math.h"41 42 39 #include "worldentities/MovableEntity.h" 43 44 40 45 41 namespace orxonox … … 50 46 JumpEnemy(Context* context); 51 47 virtual ~JumpEnemy(); 52 virtual void tick(float dt) ;53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) override; 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 54 50 void setFieldDimension(float width, float height) 55 51 { this->fieldWidth_ = width; this->fieldHeight_ = height; } -
code/trunk/src/modules/jump/JumpFigure.cc
r10262 r11071 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/XMLPort.h" 38 #include "graphics/Model.h" 39 #include "JumpRocket.h" 40 #include "JumpPropeller.h" 41 #include "JumpBoots.h" 42 #include "JumpShield.h" 38 43 39 44 namespace orxonox … … 46 51 47 52 // initialize variables 48 leftHand_ = NULL;49 rightHand_ = NULL;53 leftHand_ = nullptr; 54 rightHand_ = nullptr; 50 55 fieldHeight_ = 0; 51 56 fieldWidth_ = 0; … … 70 75 animateHands_ = false; 71 76 turnUp_ = false; 72 rocketActive_ = NULL;73 propellerActive_ = NULL;74 bootsActive_ = NULL;75 shieldActive_ = NULL;77 rocketActive_ = nullptr; 78 propellerActive_ = nullptr; 79 bootsActive_ = nullptr; 80 shieldActive_ = nullptr; 76 81 rocketSpeed_ = 0.0; 77 82 propellerSpeed_ = 0.0; … … 106 111 // Move up/down 107 112 Vector3 velocity = getVelocity(); 108 if (rocketActive_ != NULL)113 if (rocketActive_ != nullptr) 109 114 { 110 115 velocity.z = rocketSpeed_; 111 116 } 112 else if (propellerActive_ != NULL)117 else if (propellerActive_ != nullptr) 113 118 { 114 119 velocity.z = propellerSpeed_; … … 139 144 } 140 145 141 if (leftHand_ != NULL)146 if (leftHand_ != nullptr) 142 147 { 143 148 leftHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(-handAngle_)); 144 149 } 145 if (rightHand_ != NULL)150 if (rightHand_ != nullptr) 146 151 { 147 152 rightHand_->setOrientation(Vector3(0.0, 1.0, 0.0), Degree(handAngle_)); … … 207 212 { 208 213 Vector3 velocity = getVelocity(); 209 if (bootsActive_ == NULL)214 if (bootsActive_ == nullptr) 210 215 { 211 216 velocity.z = 1.2f*jumpSpeed_; … … 234 239 void JumpFigure::CollisionWithEnemy(JumpEnemy* enemy) 235 240 { 236 if (rocketActive_ == NULL && propellerActive_ == NULL && shieldActive_ == NULL)241 if (rocketActive_ == nullptr && propellerActive_ == nullptr && shieldActive_ == nullptr) 237 242 { 238 243 dead_ = true; … … 242 247 bool JumpFigure::StartRocket(JumpRocket* rocket) 243 248 { 244 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)249 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 245 250 { 246 251 attach(rocket); … … 261 266 detach(rocket); 262 267 rocket->destroy(); 263 rocketActive_ = NULL;268 rocketActive_ = nullptr; 264 269 } 265 270 266 271 bool JumpFigure::StartPropeller(JumpPropeller* propeller) 267 272 { 268 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)273 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 269 274 { 270 275 attach(propeller); … … 285 290 detach(propeller); 286 291 propeller->destroy(); 287 propellerActive_ = NULL;292 propellerActive_ = nullptr; 288 293 } 289 294 290 295 bool JumpFigure::StartBoots(JumpBoots* boots) 291 296 { 292 if (rocketActive_ == NULL && propellerActive_ == NULL && bootsActive_ == NULL)297 if (rocketActive_ == nullptr && propellerActive_ == nullptr && bootsActive_ == nullptr) 293 298 { 294 299 attach(boots); … … 309 314 detach(boots); 310 315 boots->destroy(); 311 bootsActive_ = NULL;316 bootsActive_ = nullptr; 312 317 } 313 318 314 319 bool JumpFigure::StartShield(JumpShield* shield) 315 320 { 316 if (shieldActive_ == false)321 if (shieldActive_ == nullptr) 317 322 { 318 323 attach(shield); … … 333 338 detach(shield); 334 339 shield->destroy(); 335 shieldActive_ = NULL;340 shieldActive_ = nullptr; 336 341 } 337 342 -
code/trunk/src/modules/jump/JumpFigure.h
r10262 r11071 40 40 JumpFigure(Context* context); //!< Constructor. Registers and initializes the object. 41 41 virtual ~JumpFigure() {} 42 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;43 virtual void tick(float dt) ;44 virtual void moveFrontBack(const Vector2& value) ; //!< Overloaded the function to steer the bat up and down.45 virtual void moveRightLeft(const Vector2& value) ; //!< Overloaded the function to steer the bat up and down.46 virtual void rotateYaw(const Vector2& value) ;47 virtual void rotatePitch(const Vector2& value) ;48 virtual void rotateRoll(const Vector2& value) ;42 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 43 virtual void tick(float dt) override; 44 virtual void moveFrontBack(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down. 45 virtual void moveRightLeft(const Vector2& value) override; //!< Overloaded the function to steer the bat up and down. 46 virtual void rotateYaw(const Vector2& value) override; 47 virtual void rotatePitch(const Vector2& value) override; 48 virtual void rotateRoll(const Vector2& value) override; 49 49 void fire(unsigned int firemode); 50 virtual void fired(unsigned int firemode) ;50 virtual void fired(unsigned int firemode) override; 51 51 virtual void JumpFromPlatform(JumpPlatform* platform); 52 52 virtual void JumpFromSpring(JumpSpring* spring); -
code/trunk/src/modules/jump/JumpItem.cc
r10624 r11071 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 37 #include "core/XMLPort.h" 41 38 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 39 46 40 namespace orxonox … … 54 48 attachedToFigure_ = false; 55 49 56 figure_ = 0;50 figure_ = nullptr; 57 51 height_ = 0.0; 58 52 width_ = 0.0; -
code/trunk/src/modules/jump/JumpItem.h
r10624 r11071 37 37 38 38 #include "jump/JumpPrereqs.h" 39 40 #include "util/Math.h"41 42 39 #include "worldentities/MovableEntity.h" 43 40 … … 50 47 JumpItem(Context* context); 51 48 virtual ~JumpItem(); 52 virtual void tick(float dt) ;53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;49 virtual void tick(float dt) override; 50 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 54 51 virtual void setProperties(float newLeftBoundary, float newRightBoundary, float newLowerBoundary, float newUpperBoundary, float newHSpeed, float newVSpeed); 55 52 virtual void setFigure(JumpFigure* newFigure); -
code/trunk/src/modules/jump/JumpPlatform.cc
r10632 r11071 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/GameMode.h" 38 #include "graphics/Model.h" 39 #include "gametypes/Gametype.h" 40 38 #include "core/XMLPort.h" 39 #include "sound/WorldSound.h" 41 40 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 41 46 42 namespace orxonox … … 52 48 RegisterObject(JumpPlatform); 53 49 54 figure_ = 0;50 figure_ = nullptr; 55 51 56 52 setPosition(Vector3(0,0,0)); … … 90 86 Vector3 platformPosition = this->getPosition(); 91 87 92 if (figure_ != NULL)88 if (figure_ != nullptr) 93 89 { 94 90 Vector3 figurePosition = figure_->getPosition(); -
code/trunk/src/modules/jump/JumpPlatform.h
r10632 r11071 36 36 #define _JumpPlatform_H__ 37 37 38 #include "jump/JumpPrereqs.h" 39 #include "util/Math.h" 38 #include "JumpPrereqs.h" 40 39 #include "worldentities/MovableEntity.h" 41 40 … … 47 46 JumpPlatform(Context* context); 48 47 virtual ~JumpPlatform(); 49 virtual void tick(float dt) ;50 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) override; 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 51 50 void setFigure(JumpFigure* newFigure); 52 51 virtual void touchFigure(); -
code/trunk/src/modules/jump/JumpPlatformDisappear.cc
r10262 r11071 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h"38 39 #include "gametypes/Gametype.h"40 41 37 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 38 46 39 namespace orxonox … … 58 51 { 59 52 60 }61 62 void JumpPlatformDisappear::XMLPort(Element& xmlelement, XMLPort::Mode mode)63 {64 SUPER(JumpPlatformDisappear, XMLPort, xmlelement, mode);65 }66 67 void JumpPlatformDisappear::tick(float dt)68 {69 SUPER(JumpPlatformDisappear, tick, dt);70 53 } 71 54 -
code/trunk/src/modules/jump/JumpPlatformDisappear.h
r10262 r11071 36 36 #define _JumpPlatformDisappear_H__ 37 37 38 #include "jump/JumpPrereqs.h" 39 #include "util/Math.h" 40 #include "worldentities/MovableEntity.h" 38 #include "JumpPrereqs.h" 39 #include "JumpPlatform.h" 41 40 42 41 namespace orxonox … … 47 46 JumpPlatformDisappear(Context* context); 48 47 virtual ~JumpPlatformDisappear(); 49 virtual void tick(float dt);50 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);51 48 virtual void setProperties(bool active); 52 49 virtual bool isActive(); 53 virtual void touchFigure() ;50 virtual void touchFigure() override; 54 51 55 52 protected: -
code/trunk/src/modules/jump/JumpPlatformFake.cc
r10262 r11071 33 33 34 34 #include "JumpPlatformFake.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h"37 #include "gametypes/Gametype.h"38 #include "JumpFigure.h"39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 37 42 38 namespace orxonox … … 53 49 54 50 } 55 56 void JumpPlatformFake::XMLPort(Element& xmlelement, XMLPort::Mode mode)57 {58 SUPER(JumpPlatformFake, XMLPort, xmlelement, mode);59 }60 61 void JumpPlatformFake::tick(float dt)62 {63 SUPER(JumpPlatformFake, tick, dt);64 }65 66 51 } -
code/trunk/src/modules/jump/JumpPlatformFake.h
r10262 r11071 36 36 #define _JumpPlatformFake_H__ 37 37 38 #include "jump/JumpPrereqs.h" 39 40 #include "util/Math.h" 41 42 #include "worldentities/MovableEntity.h" 43 38 #include "JumpPrereqs.h" 39 #include "JumpPlatform.h" 44 40 45 41 namespace orxonox … … 50 46 JumpPlatformFake(Context* context); 51 47 virtual ~JumpPlatformFake(); 52 virtual void tick(float dt);53 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);54 48 }; 55 49 } -
code/trunk/src/modules/jump/JumpPlatformHMove.cc
r10262 r11071 33 33 34 34 #include "JumpPlatformHMove.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h"37 #include "gametypes/Gametype.h"38 37 #include "JumpFigure.h" 39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 38 42 39 namespace orxonox … … 54 51 { 55 52 56 }57 58 void JumpPlatformHMove::XMLPort(Element& xmlelement, XMLPort::Mode mode)59 {60 SUPER(JumpPlatformHMove, XMLPort, xmlelement, mode);61 53 } 62 54 -
code/trunk/src/modules/jump/JumpPlatformHMove.h
r10262 r11071 30 30 #define _JumpPlatformHMove_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpPlatform.h" 38 34 39 35 namespace orxonox … … 45 41 JumpPlatformHMove(Context* context); 46 42 virtual ~JumpPlatformHMove(); 47 virtual void tick(float dt); 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 43 virtual void tick(float dt) override; 49 44 virtual void setProperties(float leftBoundary, float rightBoundary, float speed); 50 virtual void touchFigure() ;45 virtual void touchFigure() override; 51 46 52 47 protected: -
code/trunk/src/modules/jump/JumpPlatformStatic.cc
r10262 r11071 33 33 34 34 #include "JumpPlatformStatic.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h"37 #include "gametypes/Gametype.h"38 37 #include "JumpFigure.h" 39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 38 42 39 namespace orxonox … … 55 52 } 56 53 57 //xml port for loading sounds58 void JumpPlatformStatic::XMLPort(Element& xmlelement, XMLPort::Mode mode)59 {60 SUPER(JumpPlatformStatic, XMLPort, xmlelement, mode);61 }62 63 void JumpPlatformStatic::tick(float dt)64 {65 SUPER(JumpPlatformStatic, tick, dt);66 }67 68 54 void JumpPlatformStatic::touchFigure() 69 55 { -
code/trunk/src/modules/jump/JumpPlatformStatic.h
r10262 r11071 30 30 #define _JumpPlatformStatic_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpPlatform.h" 38 34 39 35 namespace orxonox … … 45 41 virtual ~JumpPlatformStatic(); 46 42 47 virtual void tick(float dt); 48 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 49 50 virtual void touchFigure(); 43 virtual void touchFigure() override; 51 44 }; 52 45 } -
code/trunk/src/modules/jump/JumpPlatformTimer.cc
r10262 r11071 33 33 34 34 #include "JumpPlatformTimer.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/ GameMode.h"37 #include "g ametypes/Gametype.h"37 #include "core/XMLPort.h" 38 #include "graphics/ParticleSpawner.h" 38 39 #include "JumpFigure.h" 39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 40 42 41 namespace orxonox … … 48 47 RegisterObject(JumpPlatformTimer); 49 48 50 particleSpawner_ = NULL;49 particleSpawner_ = nullptr; 51 50 52 51 setProperties(3.0); … … 72 71 73 72 time_ -= dt; 74 if (time_ < effectStartTime_ && particleSpawner_ == NULL)73 if (time_ < effectStartTime_ && particleSpawner_ == nullptr) 75 74 { 76 75 -
code/trunk/src/modules/jump/JumpPlatformTimer.h
r10262 r11071 36 36 #define _JumpPlatformTimer_H__ 37 37 38 #include "jump/JumpPrereqs.h" 39 40 #include "util/Math.h" 41 42 #include "worldentities/MovableEntity.h" 43 #include "graphics/ParticleSpawner.h" 44 38 #include "JumpPrereqs.h" 39 #include "JumpPlatform.h" 45 40 46 41 namespace orxonox … … 51 46 JumpPlatformTimer(Context* context); 52 47 virtual ~JumpPlatformTimer(); 53 virtual void tick(float dt) ;54 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void tick(float dt) override; 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 55 50 virtual void setProperties(float time); 56 51 virtual bool isActive(void); 57 virtual void touchFigure() ;52 virtual void touchFigure() override; 58 53 59 54 void setEffectPath(const std::string& effectPath) -
code/trunk/src/modules/jump/JumpPlatformVMove.cc
r10262 r11071 33 33 34 34 #include "JumpPlatformVMove.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h"37 #include "gametypes/Gametype.h"38 37 #include "JumpFigure.h" 39 #include "sound/WorldSound.h"40 #include "core/XMLPort.h"41 38 42 39 namespace orxonox … … 54 51 { 55 52 56 }57 58 void JumpPlatformVMove::XMLPort(Element& xmlelement, XMLPort::Mode mode)59 {60 SUPER(JumpPlatformVMove, XMLPort, xmlelement, mode);61 53 } 62 54 -
code/trunk/src/modules/jump/JumpPlatformVMove.h
r10262 r11071 30 30 #define _JumpPlatformVMove_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 #include "util/Math.h" 34 #include "worldentities/MovableEntity.h" 32 #include "JumpPrereqs.h" 33 #include "JumpPlatform.h" 35 34 36 35 namespace orxonox … … 41 40 JumpPlatformVMove(Context* context); 42 41 virtual ~JumpPlatformVMove(); 43 virtual void tick(float dt); 44 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 42 virtual void tick(float dt) override; 45 43 virtual void setProperties(float leftBoundary, float rightBoundary, float speed); 46 virtual void touchFigure() ;44 virtual void touchFigure() override; 47 45 48 46 protected: -
code/trunk/src/modules/jump/JumpProjectile.cc
r10624 r11071 33 33 34 34 #include "JumpProjectile.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h"37 #include "graphics/Model.h"38 #include "gametypes/Gametype.h"39 37 #include "JumpFigure.h" 40 #include "sound/WorldSound.h" 41 #include "core/XMLPort.h" 38 #include "JumpEnemy.h" 42 39 43 40 namespace orxonox … … 49 46 RegisterObject(JumpProjectile); 50 47 51 figure_ = 0;48 figure_ = nullptr; 52 49 setPosition(Vector3(0,0,0)); 53 50 setVelocity(Vector3(0,0,250.0)); … … 60 57 } 61 58 62 void JumpProjectile::XMLPort(Element& xmlelement, XMLPort::Mode mode)63 {64 SUPER(JumpProjectile, XMLPort, xmlelement, mode);65 }66 67 59 void JumpProjectile::tick(float dt) 68 60 { … … 71 63 Vector3 projectilePosition = getPosition(); 72 64 73 for ( ObjectList<JumpEnemy>::iterator it = ObjectList<JumpEnemy>::begin(); it != ObjectList<JumpEnemy>::end(); ++it)65 for (JumpEnemy* enemy : ObjectList<JumpEnemy>()) 74 66 { 75 Vector3 enemyPosition = it->getPosition();76 float enemyWidth = it->getWidth();77 float enemyHeight = it->getHeight();67 Vector3 enemyPosition = enemy->getPosition(); 68 float enemyWidth = enemy->getWidth(); 69 float enemyHeight = enemy->getHeight(); 78 70 79 71 if(projectilePosition.x > enemyPosition.x-enemyWidth && projectilePosition.x < enemyPosition.x+enemyWidth && projectilePosition.z > enemyPosition.z-enemyHeight && projectilePosition.z < enemyPosition.z+enemyHeight) 80 72 { 81 it->dead_ = true;73 enemy->dead_ = true; 82 74 } 83 75 } -
code/trunk/src/modules/jump/JumpProjectile.h
r10624 r11071 43 43 virtual ~JumpProjectile(); 44 44 45 virtual void tick(float dt); 46 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 45 virtual void tick(float dt) override; 48 46 49 47 void setFieldDimension(float width, float height) -
code/trunk/src/modules/jump/JumpPropeller.cc
r10262 r11071 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h"38 #include "graphics/Model.h"39 #include "gametypes/Gametype.h"40 41 37 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 38 46 39 namespace orxonox … … 67 60 } 68 61 69 void JumpPropeller::XMLPort(Element& xmlelement, XMLPort::Mode mode)70 {71 SUPER(JumpPropeller, XMLPort, xmlelement, mode);72 }73 74 62 void JumpPropeller::tick(float dt) 75 63 { … … 78 66 Vector3 PropellerPosition = getWorldPosition(); 79 67 80 if (attachedToFigure_ == false && figure_ != NULL)68 if (attachedToFigure_ == false && figure_ != nullptr) 81 69 { 82 70 Vector3 figurePosition = figure_->getWorldPosition(); -
code/trunk/src/modules/jump/JumpPropeller.h
r10262 r11071 30 30 #define _JumpPropeller_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 38 34 39 35 namespace orxonox … … 44 40 JumpPropeller(Context* context); 45 41 virtual ~JumpPropeller(); 46 virtual void tick(float dt); 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 48 virtual void touchFigure(); 42 virtual void tick(float dt) override; 43 virtual void touchFigure() override; 49 44 virtual float getFuelState(); 50 45 protected: -
code/trunk/src/modules/jump/JumpRocket.cc
r10262 r11071 33 33 34 34 #include "JumpRocket.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h"37 #include "graphics/Model.h"38 #include "gametypes/Gametype.h"39 37 #include "JumpFigure.h" 40 #include "sound/WorldSound.h"41 #include "core/XMLPort.h"42 38 43 39 namespace orxonox … … 64 60 } 65 61 66 void JumpRocket::XMLPort(Element& xmlelement, XMLPort::Mode mode)67 {68 SUPER(JumpRocket, XMLPort, xmlelement, mode);69 }70 71 62 void JumpRocket::tick(float dt) 72 63 { … … 75 66 Vector3 rocketPosition = getWorldPosition(); 76 67 77 if (attachedToFigure_ == false && figure_ != NULL)68 if (attachedToFigure_ == false && figure_ != nullptr) 78 69 { 79 70 Vector3 figurePosition = figure_->getWorldPosition(); -
code/trunk/src/modules/jump/JumpRocket.h
r10262 r11071 30 30 #define _JumpRocket_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 #include "util/Math.h" 34 #include "worldentities/MovableEntity.h" 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 35 34 36 35 namespace orxonox … … 41 40 JumpRocket(Context* context); 42 41 virtual ~JumpRocket(); 43 virtual void tick(float dt); 44 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 45 virtual void touchFigure(); 42 virtual void tick(float dt) override; 43 virtual void touchFigure() override; 46 44 virtual float getFuelState(); 47 45 protected: -
code/trunk/src/modules/jump/JumpScore.cc
r10624 r11071 33 33 34 34 #include "JumpScore.h" 35 35 36 #include "core/CoreIncludes.h" 36 37 #include "core/XMLPort.h" … … 38 39 #include "infos/PlayerInfo.h" 39 40 #include "Jump.h" 40 #include "sound/WorldSound.h"41 41 42 42 namespace orxonox … … 48 48 RegisterObject(JumpScore); 49 49 50 owner_ = NULL;50 owner_ = nullptr; 51 51 showScore_ = false; 52 52 showFuel_ = false; … … 73 73 SUPER(JumpScore, tick, dt); 74 74 75 if (owner_ != NULL)75 if (owner_ != nullptr) 76 76 { 77 77 if (!owner_->hasEnded()) … … 79 79 player_ = owner_->getPlayer(); 80 80 81 if (player_ != NULL)81 if (player_ != nullptr) 82 82 { 83 83 if (showScore_ == true) … … 116 116 SUPER(JumpScore, changedOwner); 117 117 118 if (this->getOwner() != NULL&& this->getOwner()->getGametype())118 if (this->getOwner() != nullptr && this->getOwner()->getGametype()) 119 119 { 120 120 this->owner_ = orxonox_cast<Jump*>(this->getOwner()->getGametype()); … … 122 122 else 123 123 { 124 this->owner_ = NULL;124 this->owner_ = nullptr; 125 125 } 126 126 } -
code/trunk/src/modules/jump/JumpScore.h
r10262 r11071 44 44 virtual ~JumpScore(); 45 45 46 virtual void tick(float dt) ;47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ;48 virtual void changedOwner() ;46 virtual void tick(float dt) override; 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 48 virtual void changedOwner() override; 49 49 50 50 void setShowScore(const bool showScore) -
code/trunk/src/modules/jump/JumpShield.cc
r10262 r11071 35 35 36 36 #include "core/CoreIncludes.h" 37 #include "core/GameMode.h"38 #include "graphics/Model.h"39 #include "gametypes/Gametype.h"40 41 37 #include "JumpFigure.h" 42 43 #include "sound/WorldSound.h"44 #include "core/XMLPort.h"45 38 46 39 namespace orxonox … … 67 60 } 68 61 69 void JumpShield::XMLPort(Element& xmlelement, XMLPort::Mode mode)70 {71 SUPER(JumpShield, XMLPort, xmlelement, mode);72 }73 74 62 void JumpShield::tick(float dt) 75 63 { … … 78 66 Vector3 shieldPosition = getWorldPosition(); 79 67 80 if (attachedToFigure_ == false && figure_ != NULL)68 if (attachedToFigure_ == false && figure_ != nullptr) 81 69 { 82 70 Vector3 figurePosition = figure_->getWorldPosition(); -
code/trunk/src/modules/jump/JumpShield.h
r10262 r11071 30 30 #define _JumpShield_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 38 34 39 35 namespace orxonox … … 44 40 JumpShield(Context* context); 45 41 virtual ~JumpShield(); 46 virtual void tick(float dt); 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 48 virtual void touchFigure(); 42 virtual void tick(float dt) override; 43 virtual void touchFigure() override; 49 44 virtual float getFuelState(); 50 45 protected: -
code/trunk/src/modules/jump/JumpSpring.cc
r10262 r11071 33 33 34 34 #include "JumpSpring.h" 35 35 36 #include "core/CoreIncludes.h" 36 #include "core/GameMode.h"37 #include "graphics/Model.h"38 #include "gametypes/Gametype.h"39 37 #include "JumpFigure.h" 40 #include "sound/WorldSound.h"41 #include "core/XMLPort.h"42 38 43 39 namespace orxonox … … 63 59 } 64 60 65 void JumpSpring::XMLPort(Element& xmlelement, XMLPort::Mode mode)66 {67 SUPER(JumpSpring, XMLPort, xmlelement, mode);68 }69 70 61 void JumpSpring::tick(float dt) 71 62 { … … 80 71 Vector3 springPosition = getWorldPosition(); 81 72 82 if (figure_ != NULL)73 if (figure_ != nullptr) 83 74 { 84 75 Vector3 figurePosition = figure_->getWorldPosition(); … … 103 94 void JumpSpring::accelerateFigure() 104 95 { 105 if (figure_ != 0)96 if (figure_ != nullptr) 106 97 { 107 98 figure_->JumpFromSpring(this); -
code/trunk/src/modules/jump/JumpSpring.h
r10262 r11071 30 30 #define _JumpSpring_H__ 31 31 32 #include "jump/JumpPrereqs.h" 33 34 #include "util/Math.h" 35 36 #include "worldentities/MovableEntity.h" 37 32 #include "JumpPrereqs.h" 33 #include "JumpItem.h" 38 34 39 35 namespace orxonox … … 44 40 JumpSpring(Context* context); 45 41 virtual ~JumpSpring(); 46 virtual void tick(float dt); 47 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 42 virtual void tick(float dt) override; 48 43 virtual void accelerateFigure(); 49 virtual void touchFigure() ;44 virtual void touchFigure() override; 50 45 protected: 51 46 float stretch_;
Note: See TracChangeset
for help on using the changeset viewer.