Deleted unused methods.

master
bog 7 years ago
parent 554442b331
commit 30f12a2d30
  1. 2
      CMakeLists.txt
  2. 9
      src/Case.cpp
  3. 15
      src/Case.h
  4. 13
      src/Hero.h
  5. 12
      src/Kraken.h
  6. 25
      src/Level.cpp
  7. 11
      src/Level.h

@ -5,6 +5,8 @@ file(GLOB
sources
src/*.cpp)
add_definitions("-Wall")
add_executable(kraken.elf
${sources})

@ -44,15 +44,6 @@ void Case::draw(int whichOneX,int whichOneY,int x, int y)
}
void Case::drawFree(int whichOneX,int whichOneY,float x, float y)
{
{m_sprite.setTextureRect(IntRect(whichOneX*(TILE_WIDTH+1),whichOneY*(TILE_HEIGHT+1),TILE_WIDTH, TILE_HEIGHT));}
m_sprite.setPosition(x,y);
m_window->draw(m_sprite);
}
Case::~Case()
{
//dtor

@ -14,26 +14,13 @@ class Case
Case(sf::RenderWindow* window, float x=0, float y=0);
virtual ~Case();
float GetpositionX() { return m_positionX; }
void SetpositionX(float val) { m_positionX = val; }
float GetpositionY() { return m_positionY; }
void SetpositionY(float val) { m_positionY = val; }
void Setposition(float x, float y){m_positionX=x;m_positionY=y;}
int Getvalue(){return m_value;}
sf::RenderWindow* Getwindow() { return m_window; }
void Setwindow(sf::RenderWindow* val) { m_window = val; }
sf::Texture Gettexture() { return m_texture; }
void Settexture(std::string name) ;
sf::Sprite Getsprite() { return m_sprite; }
void Setsprite(sf::Sprite val) { m_sprite = val; }
/// /// /// /// ///
void draw(int whichOneX,int whichOneY,int x, int y);
void drawFree(int whichOneX,int whichOneY,float x, float y);
bool ifClicked();
protected:

@ -22,10 +22,8 @@ class Hero
Hero(Kraken* kraken, float pozX, float pozY);
virtual ~Hero();
float GetspeedX() { return m_speedX; }
void SetspeedX(float val) { m_speedX = val; }
float GetspeedY() { return m_speedY; }
void SetspeedY(float val) { m_speedY = val; }
float GetpozX() { return m_pozX; }
@ -34,20 +32,10 @@ class Hero
float GetpozY() { return m_pozY; }
void SetpozY(float val) { m_pozY = val; }
bool Getattacking() { return m_attacking; }
void Setattacking(bool val) { m_attacking = val; }
sf::Vector2f Getstart() { return m_start; }
void Setstart(sf::Vector2f val) { m_start = val; }
sf::Texture Gettexture() { return m_texture; }
void Settexture(std::string name);
sf::Sprite Getsprite() { return m_sprite; }
void Setsprite(sf::Sprite val) { m_sprite = val; }
int Getstatut() { return m_statut; }
void Setstatut(int val) { m_statut = val; }
/// // /// /// // /// // /// // ///
void draw();
void update();
@ -58,7 +46,6 @@ class Hero
int convertCoordY(float a) {return int(a/TILE_HEIGHT);}
int next(float a, float b){return m_kraken->Getlevel()->getCoord(convertCoordX(a),convertCoordY(b))-'0';}
void restartClock() {m_clock.restart();}
void setAttacking(bool val){m_attacking=val;}
bool isDead() {return m_dead;}

@ -23,23 +23,14 @@ class Kraken
virtual ~Kraken();
Level* Getlevel() { return m_level; }
void Setlevel(Level* val) { m_level = val; }
sf::Texture Gettexture() { return m_texture; }
void Settexture(std::string name);
sf::Sprite Gethead() { return m_head; }
void Sethead(sf::Sprite val) { m_head = val; }
sf::Sprite Gettentacle() { return m_tentacle; }
void Settentacle(sf::Sprite val) { m_tentacle = val; }
int getcounter(){return m_counter;}
sf::Vector2f getposition(){return sf::Vector2f(pozX,pozY);}
std::vector<std::string> Gettab() { return m_tab; }
void Settab(std::vector<std::string> val) { m_tab = val; }
void placeTheHeadAnywhere();
void setNumberTenta(int a){m_numberTenta=a;}
@ -54,10 +45,9 @@ class Kraken
void setVector(std::vector<int> tab){m_coords=tab;}
const bool isDamaged(){return m_damaged;}
void Damaged(){ m_temp.restart(); m_damaged=true;}
bool isAttacking() {if (m_counter==2) return true; return false;}
const bool isDead(){if(m_life==0){return true;} else {return false;}}
void setDead(bool val){m_dead=val;}
int pickX(){return rand()%10+int(m_heroCoordX/TILE_WIDTH)-5;}
int pickY(){return rand()%10+int(m_heroCoordY/TILE_HEIGHT)-5;}
// void restart() {m_clock.restart();}

@ -20,18 +20,6 @@ Level::Level(Case* aCase, int width, int height)
}
char Level::findAnother(char val)
{
int x(0),y(0);
while (m_tab[y][x]!=val)
{
x=rand()%(m_width+1), y=rand()%(m_height+1);
}
return m_tab[y][x];
}
std::pair<int,int> Level::findAnother2(char val)
{
@ -88,19 +76,6 @@ const void Level::draw()
}
}
const void Level::show()
{
for(int i(0);i<m_height;i++)
{
for (int j(0);j<m_width;j++)
{
std::cout<<m_tab[j][i];
}
std::cout<<std::endl;
}
std::cout<<std::endl<<std::endl;
}
Level::~Level()
{
//dtor

@ -16,21 +16,14 @@ class Level
Level(Case* aCase, int width=20, int height=20);
virtual ~Level();
int Getwidth() { return m_width; }
void Setwidth(int val) { m_width = val; }
int Getheight() { return m_height; }
void Setheight(int val) { m_height = val; }
Case* Getcase() { return m_case; }
void Setcase(Case* val) { m_case = val; }
/// /// /// /// /// /// /// /// /// /// /// /// ///
void setCoordCase(int x, int y, char val) {m_tab[x][y]=val;}
char getCoord(int x, int y){ return m_tab[x][y];}
char findAnother(char val) ;
std::pair<int,int> findAnother2(char val);
void create();
const void show();
const void draw();
protected:

Loading…
Cancel
Save