the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 43 lines 977 B view raw
1#pragma once 2 3#include "Goal.h" 4#include "EntitySelector.h" 5 6class PathNavigation; 7class PathfinderMob; 8class Path; 9class AvoidPlayerGoal; 10 11class AvoidPlayerGoalEntitySelector : public EntitySelector 12{ 13private: 14 AvoidPlayerGoal *m_parent; 15 16public: 17 AvoidPlayerGoalEntitySelector(AvoidPlayerGoal *parent); 18 bool matches(shared_ptr<Entity> entity) const; 19}; 20 21class AvoidPlayerGoal : public Goal 22{ 23 friend class AvoidPlayerGoalEntitySelector; 24private: 25 PathfinderMob *mob; // Owner of this goal 26 double walkSpeedModifier, sprintSpeedModifier; 27 weak_ptr<Entity> toAvoid; 28 float maxDist; 29 Path *path; 30 PathNavigation *pathNav; 31 const type_info& avoidType; 32 EntitySelector *entitySelector; 33 34public: 35 AvoidPlayerGoal(PathfinderMob *mob, const type_info& avoidType, float maxDist, double walkSpeedModifier, double sprintSpeedModifier); 36 ~AvoidPlayerGoal(); 37 38 virtual bool canUse(); 39 virtual bool canContinueToUse(); 40 virtual void start(); 41 virtual void stop(); 42 virtual void tick(); 43};