- Timestamp:
- Dec 30, 2015, 2:31:14 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/modules
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/modules/jump/Jump.cc
r10920 r10999 610 610 const int numJ = 4; 611 611 612 enum PlatformType613 { 614 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 615 615 }; 616 616 617 enum ItemType618 { 619 ITEM_NOTHING, ITEM_SPRING, ITEM_PROPELLER, ITEM_ROCKET, ITEM_BOOTS, ITEM_SHIELD617 enum class ItemType 618 { 619 NOTHING, SPRING, PROPELLER, ROCKET, BOOTS, SHIELD 620 620 }; 621 621 … … 631 631 for (int j = 0; j < numJ; ++j) 632 632 { 633 matrix[i][j].type = P LATFORM_EMPTY;633 matrix[i][j].type = PlatformType::EMPTY; 634 634 matrix[i][j].done = false; 635 635 } … … 637 637 PlatformType platformtype1; 638 638 PlatformType platformtype2; 639 ItemType itemType = I TEM_NOTHING;639 ItemType itemType = ItemType::NOTHING; 640 640 641 641 if (rand()%2 == 0) 642 642 { 643 itemType = I TEM_SPRING;643 itemType = ItemType::SPRING; 644 644 } 645 645 else if (rand()%2 == 0 && sectionNumber_ > 3) … … 648 648 { 649 649 case 0: 650 itemType = I TEM_PROPELLER;650 itemType = ItemType::PROPELLER; 651 651 break; 652 652 case 1: 653 itemType = I TEM_ROCKET;653 itemType = ItemType::ROCKET; 654 654 break; 655 655 case 2: 656 itemType = I TEM_BOOTS;656 itemType = ItemType::BOOTS; 657 657 break; 658 658 case 3: 659 itemType = I TEM_SHIELD;659 itemType = ItemType::SHIELD; 660 660 break; 661 661 default: … … 667 667 { 668 668 case 0: 669 platformtype1 = P LATFORM_STATIC;670 platformtype2 = P LATFORM_STATIC;669 platformtype1 = PlatformType::STATIC; 670 platformtype2 = PlatformType::STATIC; 671 671 break; 672 672 case 1: 673 platformtype1 = P LATFORM_STATIC;674 platformtype2 = P LATFORM_STATIC;673 platformtype1 = PlatformType::STATIC; 674 platformtype2 = PlatformType::STATIC; 675 675 break; 676 676 case 2: 677 platformtype1 = P LATFORM_STATIC;678 platformtype2 = P LATFORM_HMOVE;677 platformtype1 = PlatformType::STATIC; 678 platformtype2 = PlatformType::HMOVE; 679 679 break; 680 680 case 3: 681 platformtype1 = P LATFORM_STATIC;682 platformtype2 = P LATFORM_DISAPPEAR;681 platformtype1 = PlatformType::STATIC; 682 platformtype2 = PlatformType::DISAPPEAR; 683 683 break; 684 684 case 4: 685 platformtype1 = P LATFORM_STATIC;686 platformtype2 = P LATFORM_VMOVE;685 platformtype1 = PlatformType::STATIC; 686 platformtype2 = PlatformType::VMOVE; 687 687 break; 688 688 case 5: 689 platformtype1 = P LATFORM_STATIC;690 platformtype2 = P LATFORM_TIMER;689 platformtype1 = PlatformType::STATIC; 690 platformtype2 = PlatformType::TIMER; 691 691 break; 692 692 case 6: 693 platformtype1 = P LATFORM_HMOVE;694 platformtype2 = P LATFORM_STATIC;693 platformtype1 = PlatformType::HMOVE; 694 platformtype2 = PlatformType::STATIC; 695 695 break; 696 696 case 7: 697 platformtype1 = P LATFORM_HMOVE;698 platformtype2 = P LATFORM_HMOVE;697 platformtype1 = PlatformType::HMOVE; 698 platformtype2 = PlatformType::HMOVE; 699 699 break; 700 700 case 8: 701 platformtype1 = P LATFORM_HMOVE;702 platformtype2 = P LATFORM_HMOVE;701 platformtype1 = PlatformType::HMOVE; 702 platformtype2 = PlatformType::HMOVE; 703 703 break; 704 704 case 9: 705 platformtype1 = P LATFORM_HMOVE;706 platformtype2 = P LATFORM_DISAPPEAR;705 platformtype1 = PlatformType::HMOVE; 706 platformtype2 = PlatformType::DISAPPEAR; 707 707 break; 708 708 case 10: 709 platformtype1 = P LATFORM_HMOVE;710 platformtype2 = P LATFORM_VMOVE;709 platformtype1 = PlatformType::HMOVE; 710 platformtype2 = PlatformType::VMOVE; 711 711 break; 712 712 case 11: 713 platformtype1 = P LATFORM_HMOVE;714 platformtype2 = P LATFORM_TIMER;713 platformtype1 = PlatformType::HMOVE; 714 platformtype2 = PlatformType::TIMER; 715 715 break; 716 716 case 12: 717 platformtype1 = P LATFORM_DISAPPEAR;718 platformtype2 = P LATFORM_STATIC;717 platformtype1 = PlatformType::DISAPPEAR; 718 platformtype2 = PlatformType::STATIC; 719 719 break; 720 720 case 13: 721 platformtype1 = P LATFORM_DISAPPEAR;722 platformtype2 = P LATFORM_HMOVE;721 platformtype1 = PlatformType::DISAPPEAR; 722 platformtype2 = PlatformType::HMOVE; 723 723 break; 724 724 case 14: 725 platformtype1 = P LATFORM_DISAPPEAR;726 platformtype2 = P LATFORM_DISAPPEAR;725 platformtype1 = PlatformType::DISAPPEAR; 726 platformtype2 = PlatformType::DISAPPEAR; 727 727 break; 728 728 case 15: 729 platformtype1 = P LATFORM_DISAPPEAR;730 platformtype2 = P LATFORM_DISAPPEAR;729 platformtype1 = PlatformType::DISAPPEAR; 730 platformtype2 = PlatformType::DISAPPEAR; 731 731 break; 732 732 case 16: 733 platformtype1 = P LATFORM_DISAPPEAR;734 platformtype2 = P LATFORM_VMOVE;733 platformtype1 = PlatformType::DISAPPEAR; 734 platformtype2 = PlatformType::VMOVE; 735 735 break; 736 736 case 17: 737 platformtype1 = P LATFORM_DISAPPEAR;738 platformtype2 = P LATFORM_TIMER;737 platformtype1 = PlatformType::DISAPPEAR; 738 platformtype2 = PlatformType::TIMER; 739 739 break; 740 740 case 18: 741 platformtype1 = P LATFORM_VMOVE;742 platformtype2 = P LATFORM_STATIC;741 platformtype1 = PlatformType::VMOVE; 742 platformtype2 = PlatformType::STATIC; 743 743 break; 744 744 case 19: 745 platformtype1 = P LATFORM_VMOVE;746 platformtype2 = P LATFORM_HMOVE;745 platformtype1 = PlatformType::VMOVE; 746 platformtype2 = PlatformType::HMOVE; 747 747 break; 748 748 case 20: 749 platformtype1 = P LATFORM_VMOVE;750 platformtype2 = P LATFORM_DISAPPEAR;749 platformtype1 = PlatformType::VMOVE; 750 platformtype2 = PlatformType::DISAPPEAR; 751 751 break; 752 752 case 21: 753 platformtype1 = P LATFORM_VMOVE;754 platformtype2 = P LATFORM_VMOVE;753 platformtype1 = PlatformType::VMOVE; 754 platformtype2 = PlatformType::VMOVE; 755 755 break; 756 756 case 22: 757 platformtype1 = P LATFORM_VMOVE;758 platformtype2 = P LATFORM_VMOVE;757 platformtype1 = PlatformType::VMOVE; 758 platformtype2 = PlatformType::VMOVE; 759 759 break; 760 760 case 23: 761 platformtype1 = P LATFORM_VMOVE;762 platformtype2 = P LATFORM_TIMER;761 platformtype1 = PlatformType::VMOVE; 762 platformtype2 = PlatformType::TIMER; 763 763 break; 764 764 case 24: 765 platformtype1 = P LATFORM_TIMER;766 platformtype2 = P LATFORM_STATIC;765 platformtype1 = PlatformType::TIMER; 766 platformtype2 = PlatformType::STATIC; 767 767 break; 768 768 case 25: 769 platformtype1 = P LATFORM_TIMER;770 platformtype2 = P LATFORM_HMOVE;769 platformtype1 = PlatformType::TIMER; 770 platformtype2 = PlatformType::HMOVE; 771 771 break; 772 772 case 26: 773 platformtype1 = P LATFORM_TIMER;774 platformtype2 = P LATFORM_DISAPPEAR;773 platformtype1 = PlatformType::TIMER; 774 platformtype2 = PlatformType::DISAPPEAR; 775 775 break; 776 776 case 27: 777 platformtype1 = P LATFORM_TIMER;778 platformtype2 = P LATFORM_VMOVE;777 platformtype1 = PlatformType::TIMER; 778 platformtype2 = PlatformType::VMOVE; 779 779 break; 780 780 case 28: 781 platformtype1 = P LATFORM_TIMER;782 platformtype2 = P LATFORM_TIMER;781 platformtype1 = PlatformType::TIMER; 782 platformtype2 = PlatformType::TIMER; 783 783 break; 784 784 default: 785 platformtype1 = P LATFORM_TIMER;786 platformtype2 = P LATFORM_TIMER;785 platformtype1 = PlatformType::TIMER; 786 platformtype2 = PlatformType::TIMER; 787 787 break; 788 788 } … … 807 807 if (platformtype1 == platformtype2 && sectionNumber_ > 10 && rand()%2 == 0) 808 808 { 809 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;810 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; 811 811 } 812 812 … … 816 816 if (rand()%2 == 0) 817 817 { 818 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;819 } 820 else 821 { 822 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; 823 823 } 824 824 } … … 827 827 if (rand()%2 == 0) 828 828 { 829 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;830 } 831 else 832 { 833 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; 834 834 } 835 835 if (rand()%2 == 0) 836 836 { 837 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;838 } 839 else 840 { 841 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; 842 842 } 843 843 } … … 846 846 if (rand()%2 == 0) 847 847 { 848 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;849 } 850 else 851 { 852 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; 853 853 } 854 854 if (rand()%2 == 0) 855 855 { 856 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;857 } 858 else 859 { 860 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; 861 861 } 862 862 if (rand()%2 == 0) 863 863 { 864 matrix[rand()%numI][rand()%numJ].type = P LATFORM_EMPTY;865 } 866 else 867 { 868 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; 869 869 } 870 870 } … … 889 889 switch(matrix[i][j].type) 890 890 { 891 case P LATFORM_EMPTY:891 case PlatformType::EMPTY: 892 892 matrix[i][j].done = true; 893 893 break; 894 case P LATFORM_STATIC:894 case PlatformType::STATIC: 895 895 xPosition = randomXPosition(numJ, j); 896 896 zPosition = sectionBegin + i*sectionLength/numI; … … 898 898 matrix[i][j].done = true; 899 899 break; 900 case P LATFORM_FAKE:900 case PlatformType::FAKE: 901 901 xPosition = randomXPosition(numJ, j); 902 902 zPosition = sectionBegin + i*sectionLength/numI; … … 904 904 matrix[i][j].done = true; 905 905 break; 906 case P LATFORM_TIMER:906 case PlatformType::TIMER: 907 907 xPosition = randomXPosition(numJ, j); 908 908 zPosition = sectionBegin + i*sectionLength/numI; … … 910 910 matrix[i][j].done = true; 911 911 break; 912 case P LATFORM_DISAPPEAR:912 case PlatformType::DISAPPEAR: 913 913 xPosition = randomXPosition(numJ, j); 914 914 zPosition = sectionBegin + i*sectionLength/numI; … … 916 916 matrix[i][j].done = true; 917 917 break; 918 case P LATFORM_HMOVE:918 case PlatformType::HMOVE: 919 919 xVelocity = randomSpeed(); 920 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) 921 921 { 922 922 leftBoundary = randomXPositionLeft(numJ, j); … … 929 929 matrix[i][j+2].done = true; 930 930 } 931 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) 932 932 { 933 933 leftBoundary = randomXPositionLeft(numJ, j); … … 949 949 } 950 950 break; 951 case P LATFORM_VMOVE:951 case PlatformType::VMOVE: 952 952 zVelocity = randomSpeed(); 953 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) 954 954 { 955 955 lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd); … … 962 962 matrix[i+2][j].done = true; 963 963 } 964 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) 965 965 { 966 966 lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd); … … 1000 1000 switch (itemType) 1001 1001 { 1002 case I TEM_ROCKET:1002 case ItemType::ROCKET: 1003 1003 addRocket(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0); 1004 1004 break; 1005 case I TEM_PROPELLER:1005 case ItemType::PROPELLER: 1006 1006 addPropeller(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0); 1007 1007 break; 1008 case I TEM_BOOTS:1008 case ItemType::BOOTS: 1009 1009 addBoots(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0); 1010 1010 break; 1011 case I TEM_SHIELD:1011 case ItemType::SHIELD: 1012 1012 addShield(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0); 1013 1013 break; … … 1020 1020 switch (itemType) 1021 1021 { 1022 case I TEM_ROCKET:1022 case ItemType::ROCKET: 1023 1023 addRocket(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed()); 1024 1024 break; 1025 case I TEM_PROPELLER:1025 case ItemType::PROPELLER: 1026 1026 addPropeller(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed()); 1027 1027 break; 1028 case I TEM_BOOTS:1028 case ItemType::BOOTS: 1029 1029 addBoots(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed()); 1030 1030 break; 1031 case I TEM_SHIELD:1031 case ItemType::SHIELD: 1032 1032 addShield(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed()); 1033 1033 break; … … 1045 1045 switch (itemType) 1046 1046 { 1047 case I TEM_SPRING:1047 case ItemType::SPRING: 1048 1048 addSpring(itemPlatform); 1049 1049 break; 1050 case I TEM_ROCKET:1050 case ItemType::ROCKET: 1051 1051 addRocket(itemPlatform); 1052 1052 break; 1053 case I TEM_PROPELLER:1053 case ItemType::PROPELLER: 1054 1054 addPropeller(itemPlatform); 1055 1055 break; 1056 case I TEM_BOOTS:1056 case ItemType::BOOTS: 1057 1057 addBoots(itemPlatform); 1058 1058 break; 1059 case I TEM_SHIELD:1059 case ItemType::SHIELD: 1060 1060 addShield(itemPlatform); 1061 1061 break; -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.h
r10817 r10999 41 41 namespace orxonox 42 42 { 43 44 namespace mini4DgamePlayerColor45 {46 enum color47 {48 none,49 red,50 blue,51 green52 };53 }54 55 43 /** 56 44 @brief -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameAI.cc
r10768 r10999 104 104 for(int k=0;k<4;k++){ 105 105 for(int l=0;l<4;l++){ 106 if (this->board_[i][j][k][l]== mini4DgamePlayerColor::none)106 if (this->board_[i][j][k][l]==Mini4DgamePlayerColor::none) 107 107 possibleMoves.push_back(Vector4(i,j,k,l)); 108 108 } -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameAI.h
r10769 r10999 88 88 std::list<Vector4> getPossibleMoves(); 89 89 void copyBoard(); 90 mini4DgamePlayerColor::color board_[4][4][4][4];90 Mini4DgamePlayerColor board_[4][4][4][4]; 91 91 }; 92 92 } -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameBoard.cc
r10768 r10999 63 63 for(int k=0;k<4;k++){ 64 64 for(int l=0;l<4;l++){ 65 this->board[i][j][k][l]= mini4DgamePlayerColor::none;65 this->board[i][j][k][l]=Mini4DgamePlayerColor::none; 66 66 this->blinkingBillboards[i][j][k][l] = nullptr; 67 67 } … … 88 88 return (move.x<4 && move.y<4 && move.z<4 && move.w<4 89 89 && move.x>=0 && move.y>=0 && move.z>=0 && move.w>=0 90 && this->board[move.x][move.y][move.z][move.w] == mini4DgamePlayerColor::none);90 && this->board[move.x][move.y][move.z][move.w] == Mini4DgamePlayerColor::none); 91 91 } 92 92 … … 95 95 const Mini4DgamePosition& move = moves.back(); 96 96 moves.pop_back(); 97 this->board[move.x][move.y][move.z][move.w] = mini4DgamePlayerColor::none;97 this->board[move.x][move.y][move.z][move.w] = Mini4DgamePlayerColor::none; 98 98 this->blinkingBillboards[move.x][move.y][move.z][move.w]->destroy(); 99 99 this->blinkingBillboards[move.x][move.y][move.z][move.w] = nullptr; … … 124 124 125 125 moves.push_back(move); 126 mini4DgamePlayerColor::color playerColor = mini4DgamePlayerColor::none;126 Mini4DgamePlayerColor playerColor = Mini4DgamePlayerColor::none; 127 127 if(player_toggle_){ 128 playerColor = mini4DgamePlayerColor::blue;128 playerColor = Mini4DgamePlayerColor::blue; 129 129 this->player_toggle_ = false; 130 130 }else{ 131 playerColor = mini4DgamePlayerColor::green;131 playerColor = Mini4DgamePlayerColor::green; 132 132 this->player_toggle_ = true; 133 133 } 134 134 135 this->board[move.x][move.y][move.z][move.w] = (mini4DgamePlayerColor::color)playerColor;135 this->board[move.x][move.y][move.z][move.w] = playerColor; 136 136 137 137 BlinkingBillboard* bb = new BlinkingBillboard(this->getContext()); … … 155 155 156 156 switch(playerColor){ 157 case mini4DgamePlayerColor::red:157 case Mini4DgamePlayerColor::red: 158 158 bb->setColour(ColourValue(1,0,0)); break; 159 case mini4DgamePlayerColor::green:159 case Mini4DgamePlayerColor::green: 160 160 bb->setColour(ColourValue(0,1,0)); break; 161 case mini4DgamePlayerColor::blue:161 case Mini4DgamePlayerColor::blue: 162 162 bb->setColour(ColourValue(0,0,1)); break; 163 163 default: break; … … 169 169 170 170 Mini4DgameWinner winner = this->getWinner(); 171 if(winner.color_ != mini4DgamePlayerColor::none)171 if(winner.color_ != Mini4DgamePlayerColor::none) 172 172 { 173 173 orxout(user_status) << "Mini4Dgame: win!!!!!!!" << endl; … … 197 197 { 198 198 Mini4DgameWinner winner; 199 winner.color_ = mini4DgamePlayerColor::none;199 winner.color_ = Mini4DgamePlayerColor::none; 200 200 201 201 //check diagonals rows-columns-height-numbers 202 202 for(int i=1; i<4; i++) 203 203 { 204 if(this->board[i][i][i][i]== mini4DgamePlayerColor::none || this->board[0][0][0][0] != this->board[i][i][i][i])204 if(this->board[i][i][i][i]==Mini4DgamePlayerColor::none || this->board[0][0][0][0] != this->board[i][i][i][i]) 205 205 break; 206 206 if(i==3) … … 218 218 for(int i=1; i<4; i++) 219 219 { 220 if(this->board[3-i][i][i][i]== mini4DgamePlayerColor::none || this->board[3][0][0][0] != this->board[3-i][i][i][i])220 if(this->board[3-i][i][i][i]==Mini4DgamePlayerColor::none || this->board[3][0][0][0] != this->board[3-i][i][i][i]) 221 221 break; 222 222 if(i==3) … … 234 234 for(int i=1; i<4; i++) 235 235 { 236 if(this->board[i][3-i][i][i]== mini4DgamePlayerColor::none || this->board[0][3][0][0] != this->board[i][3-i][i][i])236 if(this->board[i][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[0][3][0][0] != this->board[i][3-i][i][i]) 237 237 break; 238 238 if(i==3) … … 250 250 for(int i=1; i<4; i++) 251 251 { 252 if(this->board[i][i][3-i][i]== mini4DgamePlayerColor::none || this->board[0][0][3][0] != this->board[i][i][3-i][i])252 if(this->board[i][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[0][0][3][0] != this->board[i][i][3-i][i]) 253 253 break; 254 254 if(i==3) … … 266 266 for(int i=1; i<4; i++) 267 267 { 268 if(this->board[i][i][i][3-i]== mini4DgamePlayerColor::none || this->board[0][0][0][3] != this->board[i][i][i][3-i])268 if(this->board[i][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[0][0][0][3] != this->board[i][i][i][3-i]) 269 269 break; 270 270 if(i==3) … … 282 282 for(int i=1; i<4; i++) 283 283 { 284 if(this->board[3-i][3-i][i][i]== mini4DgamePlayerColor::none || this->board[3][3][0][0] != this->board[3-i][3-i][i][i])284 if(this->board[3-i][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[3][3][0][0] != this->board[3-i][3-i][i][i]) 285 285 break; 286 286 if(i==3) … … 298 298 for(int i=1; i<4; i++) 299 299 { 300 if(this->board[3-i][i][3-i][i]== mini4DgamePlayerColor::none || this->board[3][0][3][0] != this->board[3-i][i][3-i][i])300 if(this->board[3-i][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[3][0][3][0] != this->board[3-i][i][3-i][i]) 301 301 break; 302 302 if(i==3) … … 314 314 for(int i=1; i<4; i++) 315 315 { 316 if(this->board[3-i][i][i][3-i]== mini4DgamePlayerColor::none || this->board[3][0][0][3] != this->board[3-i][i][i][3-i])316 if(this->board[3-i][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[3][0][0][3] != this->board[3-i][i][i][3-i]) 317 317 break; 318 318 if(i==3) … … 334 334 for(int i=1; i<4; i++) 335 335 { 336 if(this->board[i][i][i][l]== mini4DgamePlayerColor::none || this->board[0][0][0][l] != this->board[i][i][i][l])336 if(this->board[i][i][i][l]==Mini4DgamePlayerColor::none || this->board[0][0][0][l] != this->board[i][i][i][l]) 337 337 break; 338 338 if(i==3) … … 350 350 for(int i=1; i<4; i++) 351 351 { 352 if(this->board[3-i][i][i][l]== mini4DgamePlayerColor::none || this->board[3][0][0][l] != this->board[3-i][i][i][l])352 if(this->board[3-i][i][i][l]==Mini4DgamePlayerColor::none || this->board[3][0][0][l] != this->board[3-i][i][i][l]) 353 353 break; 354 354 if(i==3) … … 366 366 for(int i=1; i<4; i++) 367 367 { 368 if(this->board[i][3-i][i][l]== mini4DgamePlayerColor::none || this->board[0][3][0][l] != this->board[i][3-i][i][l])368 if(this->board[i][3-i][i][l]==Mini4DgamePlayerColor::none || this->board[0][3][0][l] != this->board[i][3-i][i][l]) 369 369 break; 370 370 if(i==3) … … 382 382 for(int i=1; i<4; i++) 383 383 { 384 if(this->board[i][i][3-i][l]== mini4DgamePlayerColor::none || this->board[0][0][3][l] != this->board[i][i][3-i][l])384 if(this->board[i][i][3-i][l]==Mini4DgamePlayerColor::none || this->board[0][0][3][l] != this->board[i][i][3-i][l]) 385 385 break; 386 386 if(i==3) … … 403 403 for(int i=1; i<4; i++) 404 404 { 405 if(this->board[i][i][l][i]== mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])405 if(this->board[i][i][l][i]==Mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i]) 406 406 break; 407 407 if(i==3) … … 419 419 for(int i=1; i<4; i++) 420 420 { 421 if(this->board[3-i][i][l][i]== mini4DgamePlayerColor::none || this->board[3][0][l][0] != this->board[3-i][i][l][i])421 if(this->board[3-i][i][l][i]==Mini4DgamePlayerColor::none || this->board[3][0][l][0] != this->board[3-i][i][l][i]) 422 422 break; 423 423 if(i==3) … … 435 435 for(int i=1; i<4; i++) 436 436 { 437 if(this->board[i][3-i][l][i]== mini4DgamePlayerColor::none || this->board[0][3][l][0] != this->board[i][3-i][l][i])437 if(this->board[i][3-i][l][i]==Mini4DgamePlayerColor::none || this->board[0][3][l][0] != this->board[i][3-i][l][i]) 438 438 break; 439 439 if(i==3) … … 451 451 for(int i=1; i<4; i++) 452 452 { 453 if(this->board[i][i][l][3-i]== mini4DgamePlayerColor::none || this->board[0][0][l][3] != this->board[i][i][l][3-i])453 if(this->board[i][i][l][3-i]==Mini4DgamePlayerColor::none || this->board[0][0][l][3] != this->board[i][i][l][3-i]) 454 454 break; 455 455 if(i==3) … … 472 472 for(int i=1; i<4; i++) 473 473 { 474 if(this->board[i][l][i][i]== mini4DgamePlayerColor::none || this->board[0][l][0][0] != this->board[i][l][i][i])474 if(this->board[i][l][i][i]==Mini4DgamePlayerColor::none || this->board[0][l][0][0] != this->board[i][l][i][i]) 475 475 break; 476 476 if(i==3) … … 488 488 for(int i=1; i<4; i++) 489 489 { 490 if(this->board[3-i][l][i][i]== mini4DgamePlayerColor::none || this->board[3][l][0][0] != this->board[3-i][l][i][i])490 if(this->board[3-i][l][i][i]==Mini4DgamePlayerColor::none || this->board[3][l][0][0] != this->board[3-i][l][i][i]) 491 491 break; 492 492 if(i==3) … … 504 504 for(int i=1; i<4; i++) 505 505 { 506 if(this->board[i][l][3-i][i]== mini4DgamePlayerColor::none || this->board[0][l][3][0] != this->board[i][l][3-i][i])506 if(this->board[i][l][3-i][i]==Mini4DgamePlayerColor::none || this->board[0][l][3][0] != this->board[i][l][3-i][i]) 507 507 break; 508 508 if(i==3) … … 520 520 for(int i=1; i<4; i++) 521 521 { 522 if(this->board[i][l][i][3-i]== mini4DgamePlayerColor::none || this->board[0][l][0][3] != this->board[i][l][i][3-i])522 if(this->board[i][l][i][3-i]==Mini4DgamePlayerColor::none || this->board[0][l][0][3] != this->board[i][l][i][3-i]) 523 523 break; 524 524 if(i==3) … … 541 541 for(int i=1; i<4; i++) 542 542 { 543 if(this->board[l][i][i][i]== mini4DgamePlayerColor::none || this->board[l][0][0][0] != this->board[l][i][i][i])543 if(this->board[l][i][i][i]==Mini4DgamePlayerColor::none || this->board[l][0][0][0] != this->board[l][i][i][i]) 544 544 break; 545 545 if(i==3) … … 557 557 for(int i=1; i<4; i++) 558 558 { 559 if(this->board[l][3-i][i][i]== mini4DgamePlayerColor::none || this->board[l][3][0][0] != this->board[l][3-i][i][i])559 if(this->board[l][3-i][i][i]==Mini4DgamePlayerColor::none || this->board[l][3][0][0] != this->board[l][3-i][i][i]) 560 560 break; 561 561 if(i==3) … … 573 573 for(int i=1; i<4; i++) 574 574 { 575 if(this->board[l][i][3-i][i]== mini4DgamePlayerColor::none || this->board[l][0][3][0] != this->board[l][i][3-i][i])575 if(this->board[l][i][3-i][i]==Mini4DgamePlayerColor::none || this->board[l][0][3][0] != this->board[l][i][3-i][i]) 576 576 break; 577 577 if(i==3) … … 589 589 for(int i=1; i<4; i++) 590 590 { 591 if(this->board[l][i][i][3-i]== mini4DgamePlayerColor::none || this->board[l][0][0][3] != this->board[l][i][i][3-i])591 if(this->board[l][i][i][3-i]==Mini4DgamePlayerColor::none || this->board[l][0][0][3] != this->board[l][i][i][3-i]) 592 592 break; 593 593 if(i==3) … … 611 611 for(int i=1; i<4; i++) 612 612 { 613 if(this->board[i][i][k][l]== mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l])613 if(this->board[i][i][k][l]==Mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l]) 614 614 break; 615 615 if(i==3) … … 627 627 for(int i=1; i<4; i++) 628 628 { 629 if(this->board[3-i][i][k][l]== mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l])629 if(this->board[3-i][i][k][l]==Mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l]) 630 630 break; 631 631 if(i==3) … … 644 644 for(int i=1; i<4; i++) 645 645 { 646 if(this->board[i][k][i][l]== mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l])646 if(this->board[i][k][i][l]==Mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l]) 647 647 break; 648 648 if(i==3) … … 660 660 for(int i=1; i<4; i++) 661 661 { 662 if(this->board[3-i][k][i][l]== mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l])662 if(this->board[3-i][k][i][l]==Mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l]) 663 663 break; 664 664 if(i==3) … … 677 677 for(int i=1; i<4; i++) 678 678 { 679 if(this->board[i][k][l][i]== mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i])679 if(this->board[i][k][l][i]==Mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i]) 680 680 break; 681 681 if(i==3) … … 693 693 for(int i=1; i<4; i++) 694 694 { 695 if(this->board[3-i][k][l][i]== mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i])695 if(this->board[3-i][k][l][i]==Mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i]) 696 696 break; 697 697 if(i==3) … … 710 710 for(int i=1; i<4; i++) 711 711 { 712 if(this->board[k][i][i][l]== mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l])712 if(this->board[k][i][i][l]==Mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l]) 713 713 break; 714 714 if(i==3) … … 726 726 for(int i=1; i<4; i++) 727 727 { 728 if(this->board[k][3-i][i][l]== mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l])728 if(this->board[k][3-i][i][l]==Mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l]) 729 729 break; 730 730 if(i==3) … … 743 743 for(int i=1; i<4; i++) 744 744 { 745 if(this->board[k][i][l][i]== mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i])745 if(this->board[k][i][l][i]==Mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i]) 746 746 break; 747 747 if(i==3) … … 759 759 for(int i=1; i<4; i++) 760 760 { 761 if(this->board[k][3-i][l][i]== mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i])761 if(this->board[k][3-i][l][i]==Mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i]) 762 762 break; 763 763 if(i==3) … … 776 776 for(int i=1; i<4; i++) 777 777 { 778 if(this->board[k][l][i][i]== mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i])778 if(this->board[k][l][i][i]==Mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i]) 779 779 break; 780 780 if(i==3) … … 792 792 for(int i=1; i<4; i++) 793 793 { 794 if(this->board[k][l][3-i][i]== mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i])794 if(this->board[k][l][3-i][i]==Mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i]) 795 795 break; 796 796 if(i==3) … … 813 813 for(int k=0;k<4;k++){ 814 814 for(int l=0;l<4;l++){ 815 if(this->board[0][j][k][l]!= mini4DgamePlayerColor::none815 if(this->board[0][j][k][l]!= Mini4DgamePlayerColor::none 816 816 && this->board[0][j][k][l]==this->board[1][j][k][l] 817 817 && this->board[1][j][k][l]==this->board[2][j][k][l] … … 835 835 for(int k=0;k<4;k++){ 836 836 for(int l=0;l<4;l++){ 837 if(this->board[i][0][k][l]!= mini4DgamePlayerColor::none837 if(this->board[i][0][k][l]!= Mini4DgamePlayerColor::none 838 838 && this->board[i][0][k][l]==this->board[i][1][k][l] 839 839 && this->board[i][1][k][l]==this->board[i][2][k][l] … … 857 857 for(int j=0;j<4;j++){ 858 858 for(int l=0;l<4;l++){ 859 if(this->board[i][j][0][l]!= mini4DgamePlayerColor::none859 if(this->board[i][j][0][l]!= Mini4DgamePlayerColor::none 860 860 && this->board[i][j][0][l]==this->board[i][j][1][l] 861 861 && this->board[i][j][1][l]==this->board[i][j][2][l] … … 879 879 for(int j=0;j<4;j++){ 880 880 for(int k=0;k<4;k++){ 881 if(this->board[i][j][k][0]!= mini4DgamePlayerColor::none881 if(this->board[i][j][k][0]!= Mini4DgamePlayerColor::none 882 882 && this->board[i][j][k][0]==this->board[i][j][k][1] 883 883 && this->board[i][j][k][1]==this->board[i][j][k][2] -
code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameBoard.h
r10817 r10999 42 42 namespace orxonox 43 43 { 44 enum class Mini4DgamePlayerColor 45 { 46 none, 47 red, 48 blue, 49 green 50 }; 44 51 45 52 struct Mini4DgamePosition … … 58 65 int winningHeight[4]; 59 66 int winningNumber[4]; 60 intcolor_;67 Mini4DgamePlayerColor color_; 61 68 }; 62 69 … … 88 95 bool player_toggle_; 89 96 BlinkingBillboard* blinkingBillboards[4][4][4][4]; 90 intboard[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number]97 Mini4DgamePlayerColor board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number] 91 98 }; 92 99 } -
code/branches/cpp11_v2/src/modules/objects/ForceField.cc
r10919 r10999 67 67 this->setMassDiameter(0); //! We allow point-masses 68 68 this->setLength(2000); 69 this->mode_ = forceFieldMode::tube;69 this->mode_ = ForceFieldMode::tube; 70 70 71 71 this->registerVariables(); … … 115 115 void ForceField::tick(float dt) 116 116 { 117 if(this->mode_ == forceFieldMode::tube)117 if(this->mode_ == ForceFieldMode::tube) 118 118 { 119 119 // Iterate over all objects that could possibly be affected by the ForceField. … … 143 143 } 144 144 } 145 else if(this->mode_ == forceFieldMode::sphere)145 else if(this->mode_ == ForceFieldMode::sphere) 146 146 { 147 147 // Iterate over all objects that could possibly be affected by the ForceField. … … 159 159 } 160 160 } 161 else if(this->mode_ == forceFieldMode::invertedSphere)161 else if(this->mode_ == ForceFieldMode::invertedSphere) 162 162 { 163 163 // Iterate over all objects that could possibly be affected by the ForceField. … … 176 176 } 177 177 } 178 else if(this->mode_ == forceFieldMode::newtonianGravity)178 else if(this->mode_ == ForceFieldMode::newtonianGravity) 179 179 { 180 180 // Iterate over all objects that could possibly be affected by the ForceField. … … 201 201 } 202 202 } 203 else if(this->mode_ == forceFieldMode::homogen)203 else if(this->mode_ == ForceFieldMode::homogen) 204 204 { 205 205 // Iterate over all objects that could possibly be affected by the ForceField. … … 227 227 { 228 228 if(mode == ForceField::modeTube_s) 229 this->mode_ = forceFieldMode::tube;229 this->mode_ = ForceFieldMode::tube; 230 230 else if(mode == ForceField::modeSphere_s) 231 this->mode_ = forceFieldMode::sphere;231 this->mode_ = ForceFieldMode::sphere; 232 232 else if(mode == ForceField::modeInvertedSphere_s) 233 this->mode_ = forceFieldMode::invertedSphere;233 this->mode_ = ForceFieldMode::invertedSphere; 234 234 else if(mode == ForceField::modeNewtonianGravity_s) 235 this->mode_ = forceFieldMode::newtonianGravity;235 this->mode_ = ForceFieldMode::newtonianGravity; 236 236 237 237 else if(mode == ForceField::modeHomogen_s) 238 this->mode_ = forceFieldMode::homogen;238 this->mode_ = ForceFieldMode::homogen; 239 239 240 240 else 241 241 { 242 242 orxout(internal_warning) << "Wrong mode '" << mode << "' in ForceField. Setting to 'tube'." << endl; 243 this->mode_ = forceFieldMode::tube;243 this->mode_ = ForceFieldMode::tube; 244 244 } 245 245 } … … 255 255 switch(this->mode_) 256 256 { 257 case forceFieldMode::tube:257 case ForceFieldMode::tube: 258 258 return ForceField::modeTube_s; 259 case forceFieldMode::sphere:259 case ForceFieldMode::sphere: 260 260 return ForceField::modeSphere_s; 261 case forceFieldMode::invertedSphere:261 case ForceFieldMode::invertedSphere: 262 262 return ForceField::modeInvertedSphere_s; 263 case forceFieldMode::newtonianGravity:263 case ForceFieldMode::newtonianGravity: 264 264 return ForceField::modeNewtonianGravity_s; 265 265 266 case forceFieldMode::homogen:266 case ForceFieldMode::homogen: 267 267 return ForceField::modeHomogen_s; 268 268 -
code/branches/cpp11_v2/src/modules/objects/ForceField.h
r10817 r10999 52 52 @ingroup Objects 53 53 */ 54 namespace forceFieldMode 55 { 56 enum Value { 57 tube, //!< The ForceField has a tube shape. 58 sphere, //!< The ForceField has a spherical shape. 59 invertedSphere, //!< The ForceField has a spherical shape but "inverted" behavior. 60 newtonianGravity, //!< The ForceField imitates Newtonian gravitation for use in stellar bodies. 61 homogen //!< Local homogenous Force field with changeable direction for the Space Station 62 }; 63 } 54 enum class ForceFieldMode { 55 tube, //!< The ForceField has a tube shape. 56 sphere, //!< The ForceField has a spherical shape. 57 invertedSphere, //!< The ForceField has a spherical shape but "inverted" behavior. 58 newtonianGravity, //!< The ForceField imitates Newtonian gravitation for use in stellar bodies. 59 homogen //!< Local homogenous Force field with changeable direction for the Space Station 60 }; 64 61 65 62 /** … … 172 169 float massRadius_; //!< The radius of the stellar body for the Newtonian ForceField. 173 170 float halfLength_; //!< Half of the length of the ForceField. 174 intmode_; //!< The mode of the ForceField.171 ForceFieldMode mode_; //!< The mode of the ForceField. 175 172 176 173 //! Gravitational constant for Newtonian ForceFields. -
code/branches/cpp11_v2/src/modules/objects/Script.h
r10817 r10999 51 51 @brief The mode a specific @ref orxonox::Script "Script" is in. 52 52 */ 53 namespaceScriptMode53 enum class ScriptMode 54 54 { 55 enum Value 56 { 57 normal, //!< The @ref orxonox::Script "Scripts'" code is executed through the @ref orxonox::CommandExecutor "CommandExecutor". 58 lua //!< The @ref orxonox::Script "Scripts'" code is executed through lua. 59 }; 60 } 55 normal, //!< The @ref orxonox::Script "Scripts'" code is executed through the @ref orxonox::CommandExecutor "CommandExecutor". 56 lua //!< The @ref orxonox::Script "Scripts'" code is executed through lua. 57 }; 61 58 62 59 /** … … 178 175 179 176 std::string code_; //!< The code that is executed by this Script. 180 ScriptMode ::Valuemode_; //!< The mode the Script is in. Determines whether the code is executed the normal way or in lua.177 ScriptMode mode_; //!< The mode the Script is in. Determines whether the code is executed the normal way or in lua. 181 178 std::string modeStr_; //!< The mode the Script is in, as a string. Is used for networking purposes. 182 179 bool onLoad_; //!< Whether the Scripts code is executed upon loading (creation) of this Script. … … 193 190 @param mode The mode of the Script. 194 191 */ 195 inline void setMode(ScriptMode ::Valuemode)192 inline void setMode(ScriptMode mode) 196 193 { this->mode_ = mode; } 197 194 }; -
code/branches/cpp11_v2/src/modules/overlays/OverlayText.cc
r10774 r10999 42 42 RegisterClass(OverlayText); 43 43 44 static_assert((int)Ogre::TextAreaOverlayElement::Left == (int)OverlayText:: Left, "check enum");45 static_assert((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText:: Center, "check enum");46 static_assert((int)Ogre::TextAreaOverlayElement::Right == (int)OverlayText:: Right, "check enum");44 static_assert((int)Ogre::TextAreaOverlayElement::Left == (int)OverlayText::Alignment::Left, "check enum"); 45 static_assert((int)Ogre::TextAreaOverlayElement::Center == (int)OverlayText::Alignment::Center, "check enum"); 46 static_assert((int)Ogre::TextAreaOverlayElement::Right == (int)OverlayText::Alignment::Right, "check enum"); 47 47 48 48 OverlayText::OverlayText(Context* context) … … 85 85 { 86 86 if (alignment == "right") 87 this->setAlignment(OverlayText:: Right);87 this->setAlignment(OverlayText::Alignment::Right); 88 88 else if (alignment == "center") 89 this->setAlignment(OverlayText:: Center);89 this->setAlignment(OverlayText::Alignment::Center); 90 90 else // "left" and default 91 this->setAlignment(OverlayText:: Left);91 this->setAlignment(OverlayText::Alignment::Left); 92 92 } 93 93 -
code/branches/cpp11_v2/src/modules/overlays/OverlayText.h
r10817 r10999 42 42 { 43 43 public: 44 enum Alignment44 enum class Alignment 45 45 { 46 46 Left, -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc
r10916 r10999 355 355 fields_[i][j]->create(fields.at(pos), fields.at(pos+1)); 356 356 pos += 2; 357 if (fields_[i][j]->getType() == START)357 if (fields_[i][j]->getType() == TowerDefenseFieldType::START) 358 358 { 359 359 startCoord.Set(i,j); … … 379 379 TDCoordinate* nextCoord = new TDCoordinate(0,0); 380 380 381 if (thisField->getType() != STREET && thisField->getType() !=START)381 if (thisField->getType() != TowerDefenseFieldType::STREET && thisField->getType() != TowerDefenseFieldType::START) 382 382 { 383 383 return nullptr; -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseField.cc
r10765 r10999 50 50 51 51 tower_ = nullptr; 52 type_ = FREE;52 type_ = TowerDefenseFieldType::FREE; 53 53 center_ = nullptr; 54 54 upgrade_ = 0; … … 186 186 modelGround_->setMeshSource("TD_F1.mesh"); 187 187 tower_ = nullptr; 188 type_ = FREE;188 type_ = TowerDefenseFieldType::FREE; 189 189 setUpgrade(0); 190 190 setAngle(orientation); … … 195 195 modelGround_->setMeshSource("TD_S5.mesh"); 196 196 tower_ = nullptr; 197 type_ = START;197 type_ = TowerDefenseFieldType::START; 198 198 setUpgrade(0); 199 199 setAngle(orientation); … … 205 205 modelGround_->setMeshSource("TD_S4.mesh"); 206 206 tower_ = nullptr; 207 type_ = END;207 type_ = TowerDefenseFieldType::END; 208 208 setUpgrade(0); 209 209 setAngle(orientation); … … 214 214 modelGround_->setMeshSource("TD_S1.mesh"); 215 215 tower_ = nullptr; 216 type_ = STREET;216 type_ = TowerDefenseFieldType::STREET; 217 217 setUpgrade(0); 218 218 setAngle(orientation); … … 223 223 modelGround_->setMeshSource("TD_S2.mesh"); 224 224 tower_ = nullptr; 225 type_ = STREET;225 type_ = TowerDefenseFieldType::STREET; 226 226 setUpgrade(0); 227 227 setAngle(orientation); … … 232 232 modelGround_->setMeshSource("TD_S3.mesh"); 233 233 tower_ = nullptr; 234 type_ = STREET;234 type_ = TowerDefenseFieldType::STREET; 235 235 setUpgrade(0); 236 236 setAngle(orientation); … … 242 242 modelObject_->setMeshSource("TD_O1.mesh"); 243 243 tower_ = nullptr; 244 type_ = OBSTACLE;244 type_ = TowerDefenseFieldType::OBSTACLE; 245 245 setUpgrade(0); 246 246 setAngle(orientation); … … 254 254 tower_ = new TowerDefenseTower(center_->getContext()); 255 255 attach(tower_); 256 type_ = T OWER;256 type_ = TowerDefenseFieldType::TOWER; 257 257 setUpgrade(upgrade); 258 258 if (upgrade_ > 0 && modelObject_ != nullptr) -
code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseField.h
r10817 r10999 46 46 namespace orxonox 47 47 { 48 enum TowerDefenseFieldType48 enum class TowerDefenseFieldType 49 49 { 50 50 FREE, … … 64 64 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override; 65 65 const bool isFree() const 66 { return type_== FREE; }66 { return type_==TowerDefenseFieldType::FREE; } 67 67 virtual void create(char object, char param); 68 68 virtual void setCenterpoint(TowerDefenseCenterpoint* center);
Note: See TracChangeset
for help on using the changeset viewer.