init
This commit is contained in:
parent
54f5313273
commit
b49080f675
83 changed files with 2083 additions and 0 deletions
39
Placeable.h
Normal file
39
Placeable.h
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// Created by Benjamin on 1/30/2022.
|
||||
//
|
||||
|
||||
#ifndef SFML_TEMPLATE_PLACEABLE_H
|
||||
#define SFML_TEMPLATE_PLACEABLE_H
|
||||
|
||||
|
||||
#include <functional>
|
||||
#include "Group.h"
|
||||
|
||||
class Placeable : public Sprite {
|
||||
protected:
|
||||
bool placing = true;
|
||||
std::vector<int> collideLayers;
|
||||
Group *collideGroup;
|
||||
|
||||
std::function<void()> uncommand;
|
||||
Placeable **inHand;
|
||||
|
||||
float reach;
|
||||
int price;
|
||||
int* energy;
|
||||
|
||||
bool isColliding();
|
||||
public:
|
||||
Placeable(const sf::Texture &, float, float, float, int, float, int, int*, Placeable **, std::vector<int>&, Group *, Sprite *, const std::function<void()> &);
|
||||
|
||||
void setReach(float reach);
|
||||
void setCommand(const std::function<void()> &);
|
||||
bool isPlacing() const;
|
||||
std::function<void()> command;
|
||||
void update() override;
|
||||
void click() override;
|
||||
void noClick() override;
|
||||
};
|
||||
|
||||
|
||||
#endif //SFML_TEMPLATE_PLACEABLE_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue