mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-29 14:42:59 +00:00
31 lines
710 B
C++
31 lines
710 B
C++
#pragma once
|
|
|
|
#include "Goal.h"
|
|
|
|
class PathfinderMob;
|
|
class Path;
|
|
class DoorInfo;
|
|
|
|
class MoveThroughVillageGoal : public Goal {
|
|
private:
|
|
PathfinderMob* mob;
|
|
float speed;
|
|
Path* path;
|
|
std::weak_ptr<DoorInfo> doorInfo;
|
|
bool onlyAtNight;
|
|
std::vector<std::weak_ptr<DoorInfo> > visited;
|
|
|
|
public:
|
|
MoveThroughVillageGoal(PathfinderMob* mob, float speed, bool onlyAtNight);
|
|
~MoveThroughVillageGoal();
|
|
|
|
virtual bool canUse();
|
|
virtual bool canContinueToUse();
|
|
virtual void start();
|
|
virtual void stop();
|
|
|
|
private:
|
|
std::shared_ptr<DoorInfo> getNextDoorInfo(std::shared_ptr<Village> village);
|
|
bool hasVisited(std::shared_ptr<DoorInfo> di);
|
|
void updateVisited();
|
|
}; |