summaryrefslogblamecommitdiffstats
path: root/src/Mobs/Villager.h
blob: 979d2a3ac17911606eeb812072b997adfee05107 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15














                                      


                          






                                 


                                              

                                  
 
                             
                                                                   

                                                                         
                              
                                                    
 


                                                
                                        
 
                                 
                                                        
                                                               
                                                                             


        
                              
                   
                              
                            
 




   

#pragma once

#include "PassiveMonster.h"





class cVillager :
	public cPassiveMonster
{
	typedef cPassiveMonster super;
	
public:

	enum eVillagerType
	{
		vtFarmer     = 0,
		vtLibrarian  = 1,
		vtPriest     = 2,
		vtBlacksmith = 3,
		vtButcher    = 4,
		vtGeneric    = 5,
		vtMax
	} ;

	cVillager(eVillagerType VillagerType);

	CLASS_PROTODEF(cVillager);

	// Override functions
	virtual void DoTakeDamage(TakeDamageInfo & a_TDI) override;
	virtual void Tick        (float a_Dt, cChunk & a_Chunk) override;

	// cVillager functions
	bool IsBlockFarmable(BLOCKTYPE a_BlockType);

	// Farmer functions
	void HandleFarmerAttemptSpecialAction();
	void HandleFarmerAction();
	void HandleFarmerEndCountDown();

	// Get and set functions.
	int GetVilType(void) const { return m_Type; }	
	Vector3i GetCropsPos(void) const { return m_CropsPos; }
	bool DoesHaveActionActivated(void) const { return m_VillagerAction; }

private:

	int m_ActionCountDown;
	int m_Type;
	bool m_VillagerAction;
	Vector3i m_CropsPos;

} ;