Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10999


Ignore:
Timestamp:
Dec 30, 2015, 2:31:14 PM (8 years ago)
Author:
landauf
Message:

using strongly typed enum classes in various modules

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  
    610610        const int numJ = 4;
    611611
    612         enum PlatformType
    613         {
    614             PLATFORM_EMPTY, PLATFORM_STATIC, PLATFORM_HMOVE, PLATFORM_VMOVE, PLATFORM_DISAPPEAR, PLATFORM_TIMER, PLATFORM_FAKE
     612        enum class PlatformType
     613        {
     614            EMPTY, STATIC, HMOVE, VMOVE, DISAPPEAR, TIMER, FAKE
    615615        };
    616616
    617         enum ItemType
    618         {
    619             ITEM_NOTHING, ITEM_SPRING, ITEM_PROPELLER, ITEM_ROCKET, ITEM_BOOTS, ITEM_SHIELD
     617        enum class ItemType
     618        {
     619            NOTHING, SPRING, PROPELLER, ROCKET, BOOTS, SHIELD
    620620        };
    621621
     
    631631            for (int j = 0; j < numJ; ++j)
    632632            {
    633                 matrix[i][j].type = PLATFORM_EMPTY;
     633                matrix[i][j].type = PlatformType::EMPTY;
    634634                matrix[i][j].done = false;
    635635            }
     
    637637        PlatformType platformtype1;
    638638        PlatformType platformtype2;
    639         ItemType itemType = ITEM_NOTHING;
     639        ItemType itemType = ItemType::NOTHING;
    640640
    641641        if (rand()%2 == 0)
    642642        {
    643             itemType = ITEM_SPRING;
     643            itemType = ItemType::SPRING;
    644644        }
    645645        else if (rand()%2 == 0 && sectionNumber_ > 3)
     
    648648            {
    649649            case 0:
    650                 itemType = ITEM_PROPELLER;
     650                itemType = ItemType::PROPELLER;
    651651                break;
    652652            case 1:
    653                 itemType = ITEM_ROCKET;
     653                itemType = ItemType::ROCKET;
    654654                break;
    655655            case 2:
    656                 itemType = ITEM_BOOTS;
     656                itemType = ItemType::BOOTS;
    657657                break;
    658658            case 3:
    659                 itemType = ITEM_SHIELD;
     659                itemType = ItemType::SHIELD;
    660660                break;
    661661            default:
     
    667667        {
    668668        case 0:
    669             platformtype1 = PLATFORM_STATIC;
    670             platformtype2 = PLATFORM_STATIC;
     669            platformtype1 = PlatformType::STATIC;
     670            platformtype2 = PlatformType::STATIC;
    671671            break;
    672672        case 1:
    673             platformtype1 = PLATFORM_STATIC;
    674             platformtype2 = PLATFORM_STATIC;
     673            platformtype1 = PlatformType::STATIC;
     674            platformtype2 = PlatformType::STATIC;
    675675            break;
    676676        case 2:
    677             platformtype1 = PLATFORM_STATIC;
    678             platformtype2 = PLATFORM_HMOVE;
     677            platformtype1 = PlatformType::STATIC;
     678            platformtype2 = PlatformType::HMOVE;
    679679            break;
    680680        case 3:
    681             platformtype1 = PLATFORM_STATIC;
    682             platformtype2 = PLATFORM_DISAPPEAR;
     681            platformtype1 = PlatformType::STATIC;
     682            platformtype2 = PlatformType::DISAPPEAR;
    683683            break;
    684684        case 4:
    685             platformtype1 = PLATFORM_STATIC;
    686             platformtype2 = PLATFORM_VMOVE;
     685            platformtype1 = PlatformType::STATIC;
     686            platformtype2 = PlatformType::VMOVE;
    687687            break;
    688688        case 5:
    689             platformtype1 = PLATFORM_STATIC;
    690             platformtype2 = PLATFORM_TIMER;
     689            platformtype1 = PlatformType::STATIC;
     690            platformtype2 = PlatformType::TIMER;
    691691            break;
    692692        case 6:
    693             platformtype1 = PLATFORM_HMOVE;
    694             platformtype2 = PLATFORM_STATIC;
     693            platformtype1 = PlatformType::HMOVE;
     694            platformtype2 = PlatformType::STATIC;
    695695            break;
    696696        case 7:
    697             platformtype1 = PLATFORM_HMOVE;
    698             platformtype2 = PLATFORM_HMOVE;
     697            platformtype1 = PlatformType::HMOVE;
     698            platformtype2 = PlatformType::HMOVE;
    699699            break;
    700700        case 8:
    701             platformtype1 = PLATFORM_HMOVE;
    702             platformtype2 = PLATFORM_HMOVE;
     701            platformtype1 = PlatformType::HMOVE;
     702            platformtype2 = PlatformType::HMOVE;
    703703            break;
    704704        case 9:
    705             platformtype1 = PLATFORM_HMOVE;
    706             platformtype2 = PLATFORM_DISAPPEAR;
     705            platformtype1 = PlatformType::HMOVE;
     706            platformtype2 = PlatformType::DISAPPEAR;
    707707            break;
    708708        case 10:
    709             platformtype1 = PLATFORM_HMOVE;
    710             platformtype2 = PLATFORM_VMOVE;
     709            platformtype1 = PlatformType::HMOVE;
     710            platformtype2 = PlatformType::VMOVE;
    711711            break;
    712712        case 11:
    713             platformtype1 = PLATFORM_HMOVE;
    714             platformtype2 = PLATFORM_TIMER;
     713            platformtype1 = PlatformType::HMOVE;
     714            platformtype2 = PlatformType::TIMER;
    715715            break;
    716716        case 12:
    717             platformtype1 = PLATFORM_DISAPPEAR;
    718             platformtype2 = PLATFORM_STATIC;
     717            platformtype1 = PlatformType::DISAPPEAR;
     718            platformtype2 = PlatformType::STATIC;
    719719            break;
    720720        case 13:
    721             platformtype1 = PLATFORM_DISAPPEAR;
    722             platformtype2 = PLATFORM_HMOVE;
     721            platformtype1 = PlatformType::DISAPPEAR;
     722            platformtype2 = PlatformType::HMOVE;
    723723            break;
    724724        case 14:
    725             platformtype1 = PLATFORM_DISAPPEAR;
    726             platformtype2 = PLATFORM_DISAPPEAR;
     725            platformtype1 = PlatformType::DISAPPEAR;
     726            platformtype2 = PlatformType::DISAPPEAR;
    727727            break;
    728728        case 15:
    729             platformtype1 = PLATFORM_DISAPPEAR;
    730             platformtype2 = PLATFORM_DISAPPEAR;
     729            platformtype1 = PlatformType::DISAPPEAR;
     730            platformtype2 = PlatformType::DISAPPEAR;
    731731            break;
    732732        case 16:
    733             platformtype1 = PLATFORM_DISAPPEAR;
    734             platformtype2 = PLATFORM_VMOVE;
     733            platformtype1 = PlatformType::DISAPPEAR;
     734            platformtype2 = PlatformType::VMOVE;
    735735            break;
    736736        case 17:
    737             platformtype1 = PLATFORM_DISAPPEAR;
    738             platformtype2 = PLATFORM_TIMER;
     737            platformtype1 = PlatformType::DISAPPEAR;
     738            platformtype2 = PlatformType::TIMER;
    739739            break;
    740740        case 18:
    741             platformtype1 = PLATFORM_VMOVE;
    742             platformtype2 = PLATFORM_STATIC;
     741            platformtype1 = PlatformType::VMOVE;
     742            platformtype2 = PlatformType::STATIC;
    743743            break;
    744744        case 19:
    745             platformtype1 = PLATFORM_VMOVE;
    746             platformtype2 = PLATFORM_HMOVE;
     745            platformtype1 = PlatformType::VMOVE;
     746            platformtype2 = PlatformType::HMOVE;
    747747            break;
    748748        case 20:
    749             platformtype1 = PLATFORM_VMOVE;
    750             platformtype2 = PLATFORM_DISAPPEAR;
     749            platformtype1 = PlatformType::VMOVE;
     750            platformtype2 = PlatformType::DISAPPEAR;
    751751            break;
    752752        case 21:
    753             platformtype1 = PLATFORM_VMOVE;
    754             platformtype2 = PLATFORM_VMOVE;
     753            platformtype1 = PlatformType::VMOVE;
     754            platformtype2 = PlatformType::VMOVE;
    755755            break;
    756756        case 22:
    757             platformtype1 = PLATFORM_VMOVE;
    758             platformtype2 = PLATFORM_VMOVE;
     757            platformtype1 = PlatformType::VMOVE;
     758            platformtype2 = PlatformType::VMOVE;
    759759            break;
    760760        case 23:
    761             platformtype1 = PLATFORM_VMOVE;
    762             platformtype2 = PLATFORM_TIMER;
     761            platformtype1 = PlatformType::VMOVE;
     762            platformtype2 = PlatformType::TIMER;
    763763            break;
    764764        case 24:
    765             platformtype1 = PLATFORM_TIMER;
    766             platformtype2 = PLATFORM_STATIC;
     765            platformtype1 = PlatformType::TIMER;
     766            platformtype2 = PlatformType::STATIC;
    767767            break;
    768768        case 25:
    769             platformtype1 = PLATFORM_TIMER;
    770             platformtype2 = PLATFORM_HMOVE;
     769            platformtype1 = PlatformType::TIMER;
     770            platformtype2 = PlatformType::HMOVE;
    771771            break;
    772772        case 26:
    773             platformtype1 = PLATFORM_TIMER;
    774             platformtype2 = PLATFORM_DISAPPEAR;
     773            platformtype1 = PlatformType::TIMER;
     774            platformtype2 = PlatformType::DISAPPEAR;
    775775            break;
    776776        case 27:
    777             platformtype1 = PLATFORM_TIMER;
    778             platformtype2 = PLATFORM_VMOVE;
     777            platformtype1 = PlatformType::TIMER;
     778            platformtype2 = PlatformType::VMOVE;
    779779            break;
    780780        case 28:
    781             platformtype1 = PLATFORM_TIMER;
    782             platformtype2 = PLATFORM_TIMER;
     781            platformtype1 = PlatformType::TIMER;
     782            platformtype2 = PlatformType::TIMER;
    783783            break;
    784784        default:
    785             platformtype1 = PLATFORM_TIMER;
    786             platformtype2 = PLATFORM_TIMER;
     785            platformtype1 = PlatformType::TIMER;
     786            platformtype2 = PlatformType::TIMER;
    787787            break;
    788788        }
     
    807807        if (platformtype1 == platformtype2 && sectionNumber_ > 10 && rand()%2 == 0)
    808808        {
    809             matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    810             matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
     809            matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     810            matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
    811811        }
    812812
     
    816816            if (rand()%2 == 0)
    817817            {
    818                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    819             }
    820             else
    821             {
    822                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     818                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     819            }
     820            else
     821            {
     822                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    823823            }
    824824        }
     
    827827            if (rand()%2 == 0)
    828828            {
    829                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    830             }
    831             else
    832             {
    833                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     829                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     830            }
     831            else
     832            {
     833                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    834834            }
    835835            if (rand()%2 == 0)
    836836            {
    837                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    838             }
    839             else
    840             {
    841                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     837                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     838            }
     839            else
     840            {
     841                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    842842            }
    843843        }
     
    846846            if (rand()%2 == 0)
    847847            {
    848                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    849             }
    850             else
    851             {
    852                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     848                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     849            }
     850            else
     851            {
     852                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    853853            }
    854854            if (rand()%2 == 0)
    855855            {
    856                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    857             }
    858             else
    859             {
    860                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     856                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     857            }
     858            else
     859            {
     860                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    861861            }
    862862            if (rand()%2 == 0)
    863863            {
    864                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_EMPTY;
    865             }
    866             else
    867             {
    868                 matrix[rand()%numI][rand()%numJ].type = PLATFORM_FAKE;
     864                matrix[rand()%numI][rand()%numJ].type = PlatformType::EMPTY;
     865            }
     866            else
     867            {
     868                matrix[rand()%numI][rand()%numJ].type = PlatformType::FAKE;
    869869            }
    870870        }
     
    889889                    switch(matrix[i][j].type)
    890890                    {
    891                     case PLATFORM_EMPTY:
     891                    case PlatformType::EMPTY:
    892892                        matrix[i][j].done = true;
    893893                        break;
    894                     case PLATFORM_STATIC:
     894                    case PlatformType::STATIC:
    895895                        xPosition = randomXPosition(numJ, j);
    896896                        zPosition = sectionBegin + i*sectionLength/numI;
     
    898898                        matrix[i][j].done = true;
    899899                        break;
    900                     case PLATFORM_FAKE:
     900                    case PlatformType::FAKE:
    901901                        xPosition = randomXPosition(numJ, j);
    902902                        zPosition = sectionBegin + i*sectionLength/numI;
     
    904904                        matrix[i][j].done = true;
    905905                        break;
    906                     case PLATFORM_TIMER:
     906                    case PlatformType::TIMER:
    907907                        xPosition = randomXPosition(numJ, j);
    908908                        zPosition = sectionBegin + i*sectionLength/numI;
     
    910910                        matrix[i][j].done = true;
    911911                        break;
    912                     case PLATFORM_DISAPPEAR:
     912                    case PlatformType::DISAPPEAR:
    913913                        xPosition = randomXPosition(numJ, j);
    914914                        zPosition = sectionBegin + i*sectionLength/numI;
     
    916916                        matrix[i][j].done = true;
    917917                        break;
    918                     case PLATFORM_HMOVE:
     918                    case PlatformType::HMOVE:
    919919                        xVelocity = randomSpeed();
    920                         if (j <= numJ-3 && matrix[i][j+1].type == PLATFORM_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)
    921921                        {
    922922                            leftBoundary = randomXPositionLeft(numJ, j);
     
    929929                            matrix[i][j+2].done = true;
    930930                        }
    931                         else if (j <= numJ-2 && matrix[i][j+1].type == PLATFORM_HMOVE && rand()%2 == 0)
     931                        else if (j <= numJ-2 && matrix[i][j+1].type == PlatformType::HMOVE && rand()%2 == 0)
    932932                        {
    933933                            leftBoundary = randomXPositionLeft(numJ, j);
     
    949949                        }
    950950                        break;
    951                     case PLATFORM_VMOVE:
     951                    case PlatformType::VMOVE:
    952952                        zVelocity = randomSpeed();
    953                         if (i <= numI-3 && matrix[i+1][j].type == PLATFORM_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)
    954954                        {
    955955                            lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd);
     
    962962                            matrix[i+2][j].done = true;
    963963                        }
    964                         else if (i <= numI-2 && matrix[i+1][j].type == PLATFORM_VMOVE && rand()%2 == 0)
     964                        else if (i <= numI-2 && matrix[i+1][j].type == PlatformType::VMOVE && rand()%2 == 0)
    965965                        {
    966966                            lowerBoundary = randomZPositionLower(numI, i, sectionBegin, sectionEnd);
     
    10001000                switch (itemType)
    10011001                {
    1002                 case ITEM_ROCKET:
     1002                case ItemType::ROCKET:
    10031003                    addRocket(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10041004                    break;
    1005                 case ITEM_PROPELLER:
     1005                case ItemType::PROPELLER:
    10061006                    addPropeller(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10071007                    break;
    1008                 case ITEM_BOOTS:
     1008                case ItemType::BOOTS:
    10091009                    addBoots(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10101010                    break;
    1011                 case ITEM_SHIELD:
     1011                case ItemType::SHIELD:
    10121012                    addShield(0.0, randomPosition(sectionBegin, sectionBegin + sectionLength), -fieldWidth/2, fieldWidth/2, 0.0, 0.0, randomSpeed(), 0.0);
    10131013                    break;
     
    10201020                switch (itemType)
    10211021                {
    1022                 case ITEM_ROCKET:
     1022                case ItemType::ROCKET:
    10231023                    addRocket(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10241024                    break;
    1025                 case ITEM_PROPELLER:
     1025                case ItemType::PROPELLER:
    10261026                    addPropeller(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10271027                    break;
    1028                 case ITEM_BOOTS:
     1028                case ItemType::BOOTS:
    10291029                    addBoots(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10301030                    break;
    1031                 case ITEM_SHIELD:
     1031                case ItemType::SHIELD:
    10321032                    addShield(randomPosition(-fieldWidth/2, fieldWidth/2), sectionBegin + sectionLength/2, 0.0, 0.0, sectionBegin, sectionEnd, 0.0, randomSpeed());
    10331033                    break;
     
    10451045                switch (itemType)
    10461046                {
    1047                 case ITEM_SPRING:
     1047                case ItemType::SPRING:
    10481048                    addSpring(itemPlatform);
    10491049                    break;
    1050                 case ITEM_ROCKET:
     1050                case ItemType::ROCKET:
    10511051                    addRocket(itemPlatform);
    10521052                    break;
    1053                 case ITEM_PROPELLER:
     1053                case ItemType::PROPELLER:
    10541054                    addPropeller(itemPlatform);
    10551055                    break;
    1056                 case ITEM_BOOTS:
     1056                case ItemType::BOOTS:
    10571057                    addBoots(itemPlatform);
    10581058                    break;
    1059                 case ITEM_SHIELD:
     1059                case ItemType::SHIELD:
    10601060                    addShield(itemPlatform);
    10611061                    break;
  • code/branches/cpp11_v2/src/modules/mini4dgame/Mini4Dgame.h

    r10817 r10999  
    4141namespace orxonox
    4242{
    43 
    44     namespace mini4DgamePlayerColor
    45     {
    46         enum color
    47         {
    48             none,
    49             red,
    50             blue,
    51             green
    52         };
    53     }
    54 
    5543    /**
    5644    @brief
  • code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameAI.cc

    r10768 r10999  
    104104                for(int k=0;k<4;k++){
    105105                    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)
    107107                            possibleMoves.push_back(Vector4(i,j,k,l));
    108108                    }
  • code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameAI.h

    r10769 r10999  
    8888            std::list<Vector4> getPossibleMoves();
    8989            void copyBoard();
    90             mini4DgamePlayerColor::color board_[4][4][4][4];
     90            Mini4DgamePlayerColor board_[4][4][4][4];
    9191    };
    9292}
  • code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameBoard.cc

    r10768 r10999  
    6363                for(int k=0;k<4;k++){
    6464                    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;
    6666                        this->blinkingBillboards[i][j][k][l] = nullptr;
    6767                    }
     
    8888        return (move.x<4 && move.y<4 && move.z<4 && move.w<4
    8989                && 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);
    9191    }
    9292
     
    9595        const Mini4DgamePosition& move = moves.back();
    9696        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;
    9898        this->blinkingBillboards[move.x][move.y][move.z][move.w]->destroy();
    9999        this->blinkingBillboards[move.x][move.y][move.z][move.w] = nullptr;
     
    124124
    125125            moves.push_back(move);
    126             mini4DgamePlayerColor::color playerColor = mini4DgamePlayerColor::none;
     126            Mini4DgamePlayerColor playerColor = Mini4DgamePlayerColor::none;
    127127            if(player_toggle_){
    128                 playerColor = mini4DgamePlayerColor::blue;
     128                playerColor = Mini4DgamePlayerColor::blue;
    129129                this->player_toggle_ = false;
    130130            }else{
    131                 playerColor = mini4DgamePlayerColor::green;
     131                playerColor = Mini4DgamePlayerColor::green;
    132132                this->player_toggle_ = true;
    133133            }
    134134
    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;
    136136
    137137            BlinkingBillboard* bb = new BlinkingBillboard(this->getContext());
     
    155155
    156156            switch(playerColor){
    157             case mini4DgamePlayerColor::red:
     157            case Mini4DgamePlayerColor::red:
    158158                bb->setColour(ColourValue(1,0,0)); break;
    159             case mini4DgamePlayerColor::green:
     159            case Mini4DgamePlayerColor::green:
    160160                bb->setColour(ColourValue(0,1,0)); break;
    161             case mini4DgamePlayerColor::blue:
     161            case Mini4DgamePlayerColor::blue:
    162162                bb->setColour(ColourValue(0,0,1)); break;
    163163            default: break;
     
    169169
    170170            Mini4DgameWinner winner = this->getWinner();
    171             if(winner.color_ != mini4DgamePlayerColor::none)
     171            if(winner.color_ != Mini4DgamePlayerColor::none)
    172172            {
    173173                orxout(user_status) << "Mini4Dgame: win!!!!!!!" << endl;
     
    197197    {
    198198        Mini4DgameWinner winner;
    199         winner.color_ = mini4DgamePlayerColor::none;
     199        winner.color_ = Mini4DgamePlayerColor::none;
    200200
    201201        //check diagonals rows-columns-height-numbers
    202202        for(int i=1; i<4; i++)
    203203        {
    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])
    205205                break;
    206206            if(i==3)
     
    218218        for(int i=1; i<4; i++)
    219219        {
    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])
    221221                break;
    222222            if(i==3)
     
    234234        for(int i=1; i<4; i++)
    235235        {
    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])
    237237                break;
    238238            if(i==3)
     
    250250        for(int i=1; i<4; i++)
    251251        {
    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])
    253253                break;
    254254            if(i==3)
     
    266266        for(int i=1; i<4; i++)
    267267        {
    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])
    269269                break;
    270270            if(i==3)
     
    282282        for(int i=1; i<4; i++)
    283283        {
    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])
    285285                break;
    286286            if(i==3)
     
    298298        for(int i=1; i<4; i++)
    299299        {
    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])
    301301                break;
    302302            if(i==3)
     
    314314        for(int i=1; i<4; i++)
    315315        {
    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])
    317317                break;
    318318            if(i==3)
     
    334334            for(int i=1; i<4; i++)
    335335            {
    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])
    337337                    break;
    338338                if(i==3)
     
    350350            for(int i=1; i<4; i++)
    351351            {
    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])
    353353                    break;
    354354                if(i==3)
     
    366366            for(int i=1; i<4; i++)
    367367            {
    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])
    369369                    break;
    370370                if(i==3)
     
    382382            for(int i=1; i<4; i++)
    383383            {
    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])
    385385                    break;
    386386                if(i==3)
     
    403403            for(int i=1; i<4; i++)
    404404            {
    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])
    406406                    break;
    407407                if(i==3)
     
    419419            for(int i=1; i<4; i++)
    420420            {
    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])
    422422                    break;
    423423                if(i==3)
     
    435435            for(int i=1; i<4; i++)
    436436            {
    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])
    438438                    break;
    439439                if(i==3)
     
    451451            for(int i=1; i<4; i++)
    452452            {
    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])
    454454                    break;
    455455                if(i==3)
     
    472472            for(int i=1; i<4; i++)
    473473            {
    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])
    475475                    break;
    476476                if(i==3)
     
    488488            for(int i=1; i<4; i++)
    489489            {
    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])
    491491                    break;
    492492                if(i==3)
     
    504504            for(int i=1; i<4; i++)
    505505            {
    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])
    507507                    break;
    508508                if(i==3)
     
    520520            for(int i=1; i<4; i++)
    521521            {
    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])
    523523                    break;
    524524                if(i==3)
     
    541541            for(int i=1; i<4; i++)
    542542            {
    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])
    544544                    break;
    545545                if(i==3)
     
    557557            for(int i=1; i<4; i++)
    558558            {
    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])
    560560                    break;
    561561                if(i==3)
     
    573573            for(int i=1; i<4; i++)
    574574            {
    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])
    576576                    break;
    577577                if(i==3)
     
    589589            for(int i=1; i<4; i++)
    590590            {
    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])
    592592                    break;
    593593                if(i==3)
     
    611611                for(int i=1; i<4; i++)
    612612                {
    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])
    614614                        break;
    615615                    if(i==3)
     
    627627                for(int i=1; i<4; i++)
    628628                {
    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])
    630630                        break;
    631631                    if(i==3)
     
    644644                for(int i=1; i<4; i++)
    645645                {
    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])
    647647                        break;
    648648                    if(i==3)
     
    660660                for(int i=1; i<4; i++)
    661661                {
    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])
    663663                        break;
    664664                    if(i==3)
     
    677677                for(int i=1; i<4; i++)
    678678                {
    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])
    680680                        break;
    681681                    if(i==3)
     
    693693                for(int i=1; i<4; i++)
    694694                {
    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])
    696696                        break;
    697697                    if(i==3)
     
    710710                for(int i=1; i<4; i++)
    711711                {
    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])
    713713                        break;
    714714                    if(i==3)
     
    726726                for(int i=1; i<4; i++)
    727727                {
    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])
    729729                        break;
    730730                    if(i==3)
     
    743743                for(int i=1; i<4; i++)
    744744                {
    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])
    746746                        break;
    747747                    if(i==3)
     
    759759                for(int i=1; i<4; i++)
    760760                {
    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])
    762762                        break;
    763763                    if(i==3)
     
    776776                for(int i=1; i<4; i++)
    777777                {
    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])
    779779                        break;
    780780                    if(i==3)
     
    792792                for(int i=1; i<4; i++)
    793793                {
    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])
    795795                        break;
    796796                    if(i==3)
     
    813813            for(int k=0;k<4;k++){
    814814                for(int l=0;l<4;l++){
    815                     if(this->board[0][j][k][l]!= mini4DgamePlayerColor::none
     815                    if(this->board[0][j][k][l]!= Mini4DgamePlayerColor::none
    816816                       && this->board[0][j][k][l]==this->board[1][j][k][l]
    817817                       && this->board[1][j][k][l]==this->board[2][j][k][l]
     
    835835            for(int k=0;k<4;k++){
    836836                for(int l=0;l<4;l++){
    837                     if(this->board[i][0][k][l]!= mini4DgamePlayerColor::none
     837                    if(this->board[i][0][k][l]!= Mini4DgamePlayerColor::none
    838838                               && this->board[i][0][k][l]==this->board[i][1][k][l]
    839839                               && this->board[i][1][k][l]==this->board[i][2][k][l]
     
    857857            for(int j=0;j<4;j++){
    858858                for(int l=0;l<4;l++){
    859                     if(this->board[i][j][0][l]!= mini4DgamePlayerColor::none
     859                    if(this->board[i][j][0][l]!= Mini4DgamePlayerColor::none
    860860                                       && this->board[i][j][0][l]==this->board[i][j][1][l]
    861861                                       && this->board[i][j][1][l]==this->board[i][j][2][l]
     
    879879            for(int j=0;j<4;j++){
    880880                for(int k=0;k<4;k++){
    881                     if(this->board[i][j][k][0]!= mini4DgamePlayerColor::none
     881                    if(this->board[i][j][k][0]!= Mini4DgamePlayerColor::none
    882882                                       && this->board[i][j][k][0]==this->board[i][j][k][1]
    883883                                       && this->board[i][j][k][1]==this->board[i][j][k][2]
  • code/branches/cpp11_v2/src/modules/mini4dgame/Mini4DgameBoard.h

    r10817 r10999  
    4242namespace orxonox
    4343{
     44    enum class Mini4DgamePlayerColor
     45    {
     46        none,
     47        red,
     48        blue,
     49        green
     50    };
    4451
    4552    struct Mini4DgamePosition
     
    5865        int winningHeight[4];
    5966        int winningNumber[4];
    60         int color_;
     67        Mini4DgamePlayerColor color_;
    6168    };
    6269
     
    8895            bool player_toggle_;
    8996            BlinkingBillboard* blinkingBillboards[4][4][4][4];
    90             int board[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]
    9198    };
    9299}
  • code/branches/cpp11_v2/src/modules/objects/ForceField.cc

    r10919 r10999  
    6767        this->setMassDiameter(0);   //! We allow point-masses
    6868        this->setLength(2000);
    69         this->mode_ = forceFieldMode::tube;
     69        this->mode_ = ForceFieldMode::tube;
    7070       
    7171        this->registerVariables();
     
    115115    void ForceField::tick(float dt)
    116116    {
    117         if(this->mode_ == forceFieldMode::tube)
     117        if(this->mode_ == ForceFieldMode::tube)
    118118        {
    119119            // Iterate over all objects that could possibly be affected by the ForceField.
     
    143143            }
    144144        }
    145         else if(this->mode_ == forceFieldMode::sphere)
     145        else if(this->mode_ == ForceFieldMode::sphere)
    146146        {
    147147            // Iterate over all objects that could possibly be affected by the ForceField.
     
    159159            }
    160160        }
    161         else if(this->mode_ == forceFieldMode::invertedSphere)
     161        else if(this->mode_ == ForceFieldMode::invertedSphere)
    162162        {
    163163            // Iterate over all objects that could possibly be affected by the ForceField.
     
    176176            }
    177177        }
    178         else if(this->mode_ == forceFieldMode::newtonianGravity)
     178        else if(this->mode_ == ForceFieldMode::newtonianGravity)
    179179        {
    180180            // Iterate over all objects that could possibly be affected by the ForceField.
     
    201201            }
    202202        }
    203         else if(this->mode_ == forceFieldMode::homogen)
     203        else if(this->mode_ == ForceFieldMode::homogen)
    204204        {
    205205            // Iterate over all objects that could possibly be affected by the ForceField.
     
    227227    {
    228228        if(mode == ForceField::modeTube_s)
    229             this->mode_ = forceFieldMode::tube;
     229            this->mode_ = ForceFieldMode::tube;
    230230        else if(mode == ForceField::modeSphere_s)
    231             this->mode_ = forceFieldMode::sphere;
     231            this->mode_ = ForceFieldMode::sphere;
    232232        else if(mode == ForceField::modeInvertedSphere_s)
    233             this->mode_ = forceFieldMode::invertedSphere;
     233            this->mode_ = ForceFieldMode::invertedSphere;
    234234        else if(mode == ForceField::modeNewtonianGravity_s)
    235             this->mode_ = forceFieldMode::newtonianGravity;
     235            this->mode_ = ForceFieldMode::newtonianGravity;
    236236
    237237        else if(mode == ForceField::modeHomogen_s)
    238             this->mode_ = forceFieldMode::homogen;
     238            this->mode_ = ForceFieldMode::homogen;
    239239
    240240        else
    241241        {
    242242            orxout(internal_warning) << "Wrong mode '" << mode << "' in ForceField. Setting to 'tube'." << endl;
    243             this->mode_ = forceFieldMode::tube;
     243            this->mode_ = ForceFieldMode::tube;
    244244        }
    245245    }
     
    255255        switch(this->mode_)
    256256        {
    257             case forceFieldMode::tube:
     257            case ForceFieldMode::tube:
    258258                return ForceField::modeTube_s;
    259             case forceFieldMode::sphere:
     259            case ForceFieldMode::sphere:
    260260                return ForceField::modeSphere_s;
    261             case forceFieldMode::invertedSphere:
     261            case ForceFieldMode::invertedSphere:
    262262                return ForceField::modeInvertedSphere_s;
    263             case forceFieldMode::newtonianGravity:
     263            case ForceFieldMode::newtonianGravity:
    264264                return ForceField::modeNewtonianGravity_s;
    265265
    266             case forceFieldMode::homogen:
     266            case ForceFieldMode::homogen:
    267267                return ForceField::modeHomogen_s;
    268268
  • code/branches/cpp11_v2/src/modules/objects/ForceField.h

    r10817 r10999  
    5252    @ingroup Objects
    5353    */
    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    };
    6461
    6562    /**
     
    172169            float massRadius_; //!< The radius of the stellar body for the Newtonian ForceField.
    173170            float halfLength_; //!< Half of the length of the ForceField.
    174             int mode_; //!< The mode of the ForceField.
     171            ForceFieldMode mode_; //!< The mode of the ForceField.
    175172           
    176173            //! Gravitational constant for Newtonian ForceFields.
  • code/branches/cpp11_v2/src/modules/objects/Script.h

    r10817 r10999  
    5151    @brief The mode a specific @ref orxonox::Script "Script" is in.
    5252    */
    53     namespace ScriptMode
     53    enum class ScriptMode
    5454    {
    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    };
    6158
    6259    /**
     
    178175
    179176            std::string code_; //!< The code that is executed by this Script.
    180             ScriptMode::Value mode_; //!< 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.
    181178            std::string modeStr_; //!< The mode the Script is in, as a string. Is used for networking purposes.
    182179            bool onLoad_; //!< Whether the Scripts code is executed upon loading (creation) of this Script.
     
    193190            @param mode The mode of the Script.
    194191            */
    195             inline void setMode(ScriptMode::Value mode)
     192            inline void setMode(ScriptMode mode)
    196193                { this->mode_ = mode; }
    197194    };
  • code/branches/cpp11_v2/src/modules/overlays/OverlayText.cc

    r10774 r10999  
    4242    RegisterClass(OverlayText);
    4343
    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");
    4747
    4848    OverlayText::OverlayText(Context* context)
     
    8585    {
    8686        if (alignment == "right")
    87             this->setAlignment(OverlayText::Right);
     87            this->setAlignment(OverlayText::Alignment::Right);
    8888        else if (alignment == "center")
    89             this->setAlignment(OverlayText::Center);
     89            this->setAlignment(OverlayText::Alignment::Center);
    9090        else // "left" and default
    91             this->setAlignment(OverlayText::Left);
     91            this->setAlignment(OverlayText::Alignment::Left);
    9292    }
    9393
  • code/branches/cpp11_v2/src/modules/overlays/OverlayText.h

    r10817 r10999  
    4242    {
    4343    public:
    44         enum Alignment
     44        enum class Alignment
    4545        {
    4646            Left,
  • code/branches/cpp11_v2/src/modules/towerdefense/TowerDefense.cc

    r10916 r10999  
    355355                fields_[i][j]->create(fields.at(pos), fields.at(pos+1));
    356356                pos += 2;
    357                 if (fields_[i][j]->getType() == START)
     357                if (fields_[i][j]->getType() == TowerDefenseFieldType::START)
    358358                {
    359359                    startCoord.Set(i,j);
     
    379379        TDCoordinate* nextCoord = new TDCoordinate(0,0);
    380380
    381         if (thisField->getType() != STREET && thisField->getType() != START)
     381        if (thisField->getType() != TowerDefenseFieldType::STREET && thisField->getType() != TowerDefenseFieldType::START)
    382382        {
    383383            return nullptr;
  • code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseField.cc

    r10765 r10999  
    5050
    5151        tower_ = nullptr;
    52         type_ = FREE;
     52        type_ = TowerDefenseFieldType::FREE;
    5353        center_ = nullptr;
    5454        upgrade_ = 0;
     
    186186        modelGround_->setMeshSource("TD_F1.mesh");
    187187        tower_ = nullptr;
    188         type_ = FREE;
     188        type_ = TowerDefenseFieldType::FREE;
    189189        setUpgrade(0);
    190190        setAngle(orientation);
     
    195195        modelGround_->setMeshSource("TD_S5.mesh");
    196196        tower_ = nullptr;
    197         type_ = START;
     197        type_ = TowerDefenseFieldType::START;
    198198        setUpgrade(0);
    199199        setAngle(orientation);   
     
    205205        modelGround_->setMeshSource("TD_S4.mesh");
    206206        tower_ = nullptr;
    207         type_ = END;
     207        type_ = TowerDefenseFieldType::END;
    208208        setUpgrade(0);
    209209        setAngle(orientation);
     
    214214        modelGround_->setMeshSource("TD_S1.mesh");
    215215        tower_ = nullptr;
    216         type_ = STREET;
     216        type_ = TowerDefenseFieldType::STREET;
    217217        setUpgrade(0);
    218218        setAngle(orientation);
     
    223223        modelGround_->setMeshSource("TD_S2.mesh");
    224224        tower_ = nullptr;
    225         type_ = STREET;
     225        type_ = TowerDefenseFieldType::STREET;
    226226        setUpgrade(0);
    227227        setAngle(orientation);
     
    232232        modelGround_->setMeshSource("TD_S3.mesh");
    233233        tower_ = nullptr;
    234         type_ = STREET;
     234        type_ = TowerDefenseFieldType::STREET;
    235235        setUpgrade(0);
    236236        setAngle(orientation);
     
    242242        modelObject_->setMeshSource("TD_O1.mesh");
    243243        tower_ = nullptr;
    244         type_ = OBSTACLE;
     244        type_ = TowerDefenseFieldType::OBSTACLE;
    245245        setUpgrade(0);
    246246        setAngle(orientation);
     
    254254            tower_ = new TowerDefenseTower(center_->getContext());
    255255            attach(tower_);
    256             type_ = TOWER;
     256            type_ = TowerDefenseFieldType::TOWER;
    257257            setUpgrade(upgrade);
    258258            if (upgrade_ > 0 && modelObject_ != nullptr)
  • code/branches/cpp11_v2/src/modules/towerdefense/TowerDefenseField.h

    r10817 r10999  
    4646namespace orxonox
    4747{
    48     enum TowerDefenseFieldType
     48    enum class TowerDefenseFieldType
    4949    {
    5050        FREE,
     
    6464            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6565            const bool isFree() const
    66                 { return type_==FREE; }
     66                { return type_==TowerDefenseFieldType::FREE; }
    6767            virtual void create(char object, char param);
    6868            virtual void setCenterpoint(TowerDefenseCenterpoint* center);
Note: See TracChangeset for help on using the changeset viewer.