Skip to content

Commit

Permalink
update inheritance of entity, charac, wall
Browse files Browse the repository at this point in the history
  • Loading branch information
ctmbl committed Dec 15, 2021
1 parent 4ee8fe9 commit 273e68e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 28 deletions.
30 changes: 13 additions & 17 deletions include/entity/character.h
Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
#ifndef CHARACTER_H
#define CHARACTER_H
#include "controllable.h"
#include "drawable_handler.h"
#include "physical_entity.h"
#include "schedulable.h"
#include "entity.h"
#include <vector>



class Character : Controllable, DrawableHandler, PhysicalEntity, Schedulable
class Character : public Entity
{
private:

std::vector<Hitbox> attackHitbox;
std::vector<Hitbox> attackHitbox; //in a strategy ?
Hitbox damageHitbox;


public:

Character(/* args */);
~Character();

virtual void sendEvent( sf::Event e );


float maxLife;
float maxLife; //to be update if a charac is considered as an agglo of body parts
float currentLife;
float strength;
float speed;
float maxSpeed;
float jumpHeight;


public:

Character(std::vector<Strategy*> strategies); //or every player has the same strategies ? to be discussed...
~Character();

};

//in .cpp:

Character::Character(/* args */)
{
//initialize startegies of parent class !
}

Character::~Character()
Expand Down
16 changes: 11 additions & 5 deletions include/entity/entity.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
#ifndef ENTITY_H
#define ENTITY_H

class Entity
#include "strategy.h"
#include <vector>

class Entity //maybe virtual class ? let's see if this is usefull or not later
{
private:

std::vector<Strategy*> strategies;
public:
Entity();
Entity(std::vector<Strategy*> strategies);
~Entity();
};

Entity::Entity()
{
//in .cpp :


Entity::Entity(std::vector<Strategy*> strategies){
//this->strategies = strategies;
}

Entity::~Entity()
Expand Down
13 changes: 7 additions & 6 deletions include/entity/wall.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#ifndef WALL_H
#define WALL_H
#include "drawable_handler.h"
#include "physical_entity.h"
#include "entity.h"



class Wall: DrawableHandler, PhysicalEntity
class Wall: Entity
{
private:
//properties as visible, physical (can we pass through, or only some charcac ?) will be store in strategies

public:
Wall(/* args */);
Wall(std::vector<Strategy*> strategies);// same question as character
~Wall();
};

// in .cpp :

Wall::Wall(/* args */)
{

}

Wall::~Wall()
Expand Down

0 comments on commit 273e68e

Please sign in to comment.