EchoesOfFate
A game for our COMP315 Project
 
Loading...
Searching...
No Matches
NPC Class Reference

NPC class inherits Interactable class. More...

#include <NPC.h>

Inheritance diagram for NPC:
Interactable

Public Member Functions

 NPC (std::string characterSprite, float npcXPos, float npcYPos)
 interactiable gets initalized before NPC constructor, beacuse it is a super type of NPC(NPC inherits Interactable)
 
 ~NPC ()
 
void renderNPC (RenderWindow &window)
 
void update (RenderWindow &window, const Player &player) override
 what is displayed
 
- Public Member Functions inherited from Interactable
 Interactable (std::string interactableTexturePath, std::string interactableName, float interactableRadius, float interactableXRelMap, float interactableYRelMap)
 
float getRadius () const
 
bool playerInRange (const Player &player)
 
void drawInteractable (RenderWindow &window, const Player &player)
 

Static Public Member Functions

static std::unique_ptr< NPCcreateNPC (std::string characterSprite, float npcXPos, float npcYPos)
 static function so we can access it without creating an instance of the NPC class
 

Detailed Description

NPC class inherits Interactable class.

Constructor & Destructor Documentation

◆ NPC()

NPC::NPC ( std::string characterSprite,
float npcXPos,
float npcYPos )

interactiable gets initalized before NPC constructor, beacuse it is a super type of NPC(NPC inherits Interactable)

gets NPC textture

set NPC sprite

◆ ~NPC()

NPC::~NPC ( )

Member Function Documentation

◆ createNPC()

std::unique_ptr< NPC > NPC::createNPC ( std::string characterSprite,
float npcXPos,
float npcYPos )
static

static function so we can access it without creating an instance of the NPC class

returns a unique NPC pointer

◆ renderNPC()

void NPC::renderNPC ( RenderWindow & window)

◆ update()

void NPC::update ( RenderWindow & window,
const Player & player )
overridevirtual

what is displayed

handles when an NPC is interacted with

draws the pickup text and sets interacted

Reimplemented from Interactable.


The documentation for this class was generated from the following files: