#pragma once class Village { private: Level *level; vector > doorInfos; Pos *accCenter; Pos *center; int radius; int stableSince; int _tick; int populationSize; int noBreedTimer; unordered_map playerStanding; class Aggressor { public: shared_ptr mob; int timeStamp; Aggressor(shared_ptr mob, int timeStamp); }; vector aggressors; int golemCount; public: Village(); Village(Level *level); ~Village(); void setLevel(Level *level); void tick(int tick); private: Vec3 *findRandomSpawnPos(int x, int y, int z, int sx, int sy, int sz); bool canSpawnAt(int x, int y, int z, int sx, int sy, int sz); void countGolem(); void countPopulation(); public: Pos *getCenter(); int getRadius(); int getDoorCount(); int getStableAge(); int getPopulationSize(); bool isInside(int xx, int yy, int zz); vector > *getDoorInfos(); shared_ptr getClosestDoorInfo(int x, int y, int z); shared_ptr getBestDoorInfo(int x, int y, int z); bool hasDoorInfo(int x, int y, int z); shared_ptr getDoorInfo(int x, int y, int z); void addDoorInfo(shared_ptr di); bool canRemove(); void addAggressor(shared_ptr mob); shared_ptr getClosestAggressor(shared_ptr from); shared_ptr getClosestBadStandingPlayer(shared_ptr from); // 4J Stu - Should be LivingEntity when we add that private: void updateAggressors(); void updateDoors(); bool isDoor(int x, int y, int z); void calcInfo(); public: int getStanding(const wstring &playerName); int modifyStanding(const wstring &playerName, int delta); bool isGoodStanding(const wstring &playerName); bool isBadStanding(const wstring &playerName); bool isVeryBadStanding(const wstring playerName); void readAdditionalSaveData(CompoundTag *tag); void addAdditonalSaveData(CompoundTag *tag); void resetNoBreedTimer(); bool isBreedTimerOk(); void rewardAllPlayers(int amount); };