-
Notifications
You must be signed in to change notification settings - Fork 0
/
Besucher.h
67 lines (55 loc) · 1.71 KB
/
Besucher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef BESUCHER_H
#define BESUCHER_H 0
#include <cstdlib>
#include <memory>
#include <vector>
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/System/Vector2.hpp>
#include "Main.h"
#include "Spieler.h"
class Spieler;
class Besucher
{
public:
sf::Color color;
int interaktionCooldown;
sf::Vector2f movement;
sf::Vector2f position;
std::vector<float> mFandom;
int mAggressionLvl;
int aggro;
int mood;
bool haveMerch();
Besucher(sf::Vector2f pos, int radius, sf::Color color, sf::Vector2f mov, int charisma, int lambda, std::vector<float> fandom, std::shared_ptr<std::vector<sf::Texture>> textures);
static int getWaveDifference(int wl1, int wl2)
{
if (wl1 > wl2)
return ( wl1 - wl2 < wl2 + 10 - wl1 ? wl1 - wl2 : wl2 + 10 - wl1 );
else
return ( wl2 - wl1 < wl1 + 10 - wl2 ? wl2 - wl1 : wl1 + 10 - wl2 );
}
void update(int ellapsedTick, std::shared_ptr<std::vector<Spieler>> spieler);
void draw(std::shared_ptr<sf::RenderWindow> win);
bool canInteract(){return (interaktionCooldown <= 0);}
bool collided(Besucher *besucher);
float maxFandom();
int whichIsTheMaxFandom();
float standhaftigkeit();
bool converge(Besucher *besucher);
void increaseAggression(int playerId);
void addStun(int stun);
void addMerch(size_t units);
void giveMerch(Besucher *besucher);
private:
std::shared_ptr<std::vector<sf::Texture>> mTextures;
int mStun;
int mRadius;
int mSpeed;
int mCharisma; // range 1 to 10
int mWavelength; //range 1 to 10
int mNMerch;
bool mEvil;
};
void besucherCollision(std::shared_ptr<std::vector<Besucher>> besucher);
#endif /* !BESUCHER_H */