Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 15, 2015, 2:20:34 PM (9 years ago)
Author:
fvultier
Message:

Removed unuses classes and templates. The enemies move now along a path defined in the XML level file and no more along a static hard coded path.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/towerdefenseFabien/src/modules/towerdefense/TowerDefenseCenterpoint.h

    r9667 r10586  
    4141#include <string>
    4242#include <util/Math.h>
    43 
     43#include "TowerDefenseTower.h"
    4444#include "worldentities/MobileEntity.h"
    4545
     
    6060            void setWidth(unsigned int width)
    6161                { this->width_ = width; }
    62 
    6362            unsigned int getWidth(void) const
    6463                { return this->width_; }
    65 
    6664            void setHeight(unsigned int height)
    6765                { this->height_ = height; }
    68 
    6966            unsigned int getHeight(void) const
    7067                { return this->height_; }
     68            void setFields(const std::string& newFields)
     69                { this->fields_ = newFields; trimString(&fields_); }
     70            const std::string& getFields() const
     71                { return this->fields_; }                   
     72            void setSelecterTemplate(const std::string& newTemplate)
     73                { this->selecterTemplate_ = newTemplate; }
     74            const std::string& getSelecterTemplate() const
     75                { return this->selecterTemplate_; }   
     76
     77            void setTower1Template(const std::string& newTemplate)
     78                { this->towerTemplates_[0] = newTemplate;}
     79            const std::string& getTower1Template() const
     80                { return this->towerTemplates_[0]; } 
     81            void setTower2Template(const std::string& newTemplate)
     82                { this->towerTemplates_[1] = newTemplate; }
     83            const std::string& getTower2Template() const
     84                { return this->towerTemplates_[1]; }
     85            void setTower3Template(const std::string& newTemplate)
     86                { this->towerTemplates_[2] = newTemplate; }
     87            const std::string& getTower3Template() const
     88                { return this->towerTemplates_[2]; }
     89            void setTower4Template(const std::string& newTemplate)
     90                { this->towerTemplates_[3] = newTemplate; }
     91            const std::string& getTower4Template() const
     92                { return this->towerTemplates_[3]; }
     93            void setTower5Template(const std::string& newTemplate)
     94                { this->towerTemplates_[4] = newTemplate; }
     95            const std::string& getTower5Template() const
     96                { return this->towerTemplates_[4]; } 
     97
     98            void setTower1Cost(const int& newCost)
     99                { this->towerCosts_[0] = newCost;}
     100            const int& getTower1Cost() const
     101                { return this->towerCosts_[0]; } 
     102            void setTower2Cost(const int& newCost)
     103                { this->towerCosts_[1] = newCost; }
     104            const int& getTower2Cost() const
     105                { return this->towerCosts_[1]; }
     106            void setTower3Cost(const int& newCost)
     107                { this->towerCosts_[2] = newCost; }
     108            const int& getTower3Cost() const
     109                { return this->towerCosts_[2]; }
     110            void setTower4Cost(const int& newCost)
     111                { this->towerCosts_[3] = newCost; }
     112            const int& getTower4Cost() const
     113                { return this->towerCosts_[3]; }
     114            void setTower5Cost(const int& newCost)
     115                { this->towerCosts_[4] = newCost; }
     116            const int& getTower5Cost() const
     117                { return this->towerCosts_[4]; }
     118
     119            const int getTowerCost(int upgrade) const;
     120                                           
    71121
    72122            /**
     
    79129                { return this->tileScale_; }
    80130
    81             /**
    82             @brief Set the template for the towers.
    83             @param template The template name to be applied to each tower.
    84             */
    85             void setTowerTemplate(const std::string& templateName)
    86                 { this->towerTemplate_ = templateName; }
    87 
    88             const std::string& getTowerTemplate(void) const
    89                 { return this->towerTemplate_; }
    90 
    91131        private:
    92132            void checkGametype();
    93 
     133            void trimString(std::string*);
     134            std::string selecterTemplate_;
     135            std::string towerTemplates_[5];
     136            int towerCosts_[5];
     137            std::string fields_;
    94138            unsigned int width_;
    95139            unsigned int height_;
    96140            unsigned int tileScale_;
    97 
    98             std::string towerTemplate_;
    99141    };
    100142}
Note: See TracChangeset for help on using the changeset viewer.