EchoesOfFate
A game for our COMP315 Project
 
Loading...
Searching...
No Matches
NPC.h
Go to the documentation of this file.
1#ifndef NPC_H
2#define NPC_H
3
4#include <SFML/Graphics.hpp>
5#include <memory>
6
7#include "Interactable.h"
8
9using namespace sf;
10
12class NPC : public Interactable
13{
14 private:
15 Texture characterTexture;
16 Sprite character;
17 float npcXPos;
18 float npcYPos;
19
20
21 public:
22 NPC(std::string characterSprite, float npcXPos, float npcYPos);
23 ~NPC();
24
25 void renderNPC(RenderWindow& window);
26 void update(RenderWindow& window, const Player& player) override;
27
29 static std::unique_ptr<NPC> createNPC(std::string characterSprite, float npcXPos, float npcYPos);
30};
31
32
33#endif
34
35
Interactable(std::string interactableTexturePath, std::string interactableName, float interactableRadius, float interactableXRelMap, float interactableYRelMap)
Definition Interactable.cpp:3
~NPC()
Definition NPC.cpp:19
NPC(std::string characterSprite, float npcXPos, float npcYPos)
interactiable gets initalized before NPC constructor, beacuse it is a super type of NPC(NPC inherits ...
Definition NPC.cpp:6
void update(RenderWindow &window, const Player &player) override
what is displayed
Definition NPC.cpp:29
void renderNPC(RenderWindow &window)
Definition NPC.cpp:23
static std::unique_ptr< NPC > createNPC(std::string characterSprite, float npcXPos, float npcYPos)
static function so we can access it without creating an instance of the NPC class
Definition NPC.cpp:42
Definition Player.h:17