1
0
cuberite-2a/src/Mobs/Villager.h
peterbell10 ee84197014
Force all headers other than "Globals.h" to be included with relative paths (#4269)
Closes #4236

CMake now creates a header file in the build directory under the path "include/Globals.h" which just includes "src/Globals.h" with an absolute path. Then instead of adding "src/" to the include directories, it adds "include/".

#include "Globals.h" still works by including the build generated file and any other src-relative path will not work.
2018-08-29 01:51:25 +01:00

67 lines
1.4 KiB
C++

#pragma once
#include "PassiveMonster.h"
#include "../Blocks/ChunkInterface.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)
// cEntity overrides
virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
virtual void Tick (std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
// cVillager functions
/** return true if the given blocktype are: crops, potatoes or carrots. */
bool IsBlockFarmable(BLOCKTYPE a_BlockType);
// Farmer functions
/** Searches in a 11x7x11 area for crops. If it found some it will navigate to them. */
void HandleFarmerPrepareFarmCrops();
/** Looks if the farmer has reached it's destination, and if it's still crops and the destination is closer then 2 blocks it will harvest them. */
void HandleFarmerTryHarvestCrops();
/** Replaces the crops he harvested. */
void HandleFarmerPlaceCrops();
// 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;
} ;