Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 15, 2014, 3:58:14 PM (9 years ago)
Author:
maxima
Message:

towerdefenseHS14 merged.

Location:
code/branches/presentationHS14
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS14

  • code/branches/presentationHS14/src/modules/towerdefense/TowerDefense.h

    r9667 r10181  
    3737#ifndef _TowerDefense_H__
    3838#define _TowerDefense_H__
    39 
     39#include "TDCoordinate.h"
    4040#include "towerdefense/TowerDefensePrereqs.h"
    4141#include "gametypes/Deathmatch.h"
    42 
    43  #include "TowerDefensePlayerStats.h"
     42#include "TowerDefenseEnemy.h"
     43#include "util/Output.h"
     44#include "core/object/WeakPtr.h"
    4445
    4546namespace orxonox
     
    5152        virtual ~TowerDefense();
    5253
     54        std::vector<orxonox::WeakPtr<TowerDefenseEnemy> > TowerDefenseEnemyvector;
     55        bool towermatrix[16][16];
     56        void addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr);
    5357        virtual void start(); //<! The function is called when the gametype starts
    5458        virtual void end();
     
    5660        //virtual void playerEntered(PlayerInfo* player);
    5761        //virtual bool playerLeft(PlayerInfo* player);
     62        //Player Stats (set,get, reduce)
     63        int getCredit(){        return this->credit_;   }
     64        int getLifes(){         return this->lifes_;    }
     65        int getWaveNumber(){    return this->waves_;    }
     66        void setCredit(int credit){ credit_ = credit; }
     67        void setLifes(int lifes){ lifes_ = lifes; }
     68        void setWaveNumber(int wavenumber){waves_=wavenumber;   }
     69        void buyTower(int cost){ credit_ -= cost;}
     70        void addCredit(int credit) {    credit_+=credit;        }
     71        void nextwave(){ waves_++;}
     72        int reduceLifes(int NumberofLifes){     return lifes_-=NumberofLifes;   }
    5873
    5974        //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
     
    6984        void addTower(int x, int y);
    7085
     86        void upgradeTower(int x, int y);
    7187        /* Part of a temporary hack to allow the player to add towers */
    7288        ConsoleCommand* dedicatedAddTower_;
     89        ConsoleCommand* dedicatedUpgradeTower_;
    7390
    7491        //TODO: void spawnNewWave()
     
    7996    private:
    8097        TowerDefenseCenterpoint *center_;
     98        float time;
     99        float time2;
     100        int credit_;
     101        int waves_;
     102        int lifes_;
    81103
    82104        /* handles stats */
    83         TowerDefensePlayerStats *stats_;
    84         bool hasEnoughCreditForTower(TowerCost towerCost);
     105        bool hasEnoughCreditForTower(int towerCost);
     106        bool hasEnoughCreditForUpgrade();
    85107
    86         bool towerExists(int x, int y);
    87108
    88         typedef struct {
    89             int x;
    90             int y;
    91         } Coordinate;
    92109
    93         std::vector<Coordinate> addedTowersCoordinates_;
    94         std::vector<Tower*> towers_;
     110        std::vector<TowerTurret*> towers_;
    95111    };
    96112}
Note: See TracChangeset for help on using the changeset viewer.