Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

using strongly typed enum classes in various modules

Location:
code/branches/cpp11_v2/src/modules/towerdefense
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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.