ICT290 / src / scene / AIController / Goals / GoalSeekToPosition.h
GoalSeekToPosition.h
Raw
#pragma once
//#pragma warning (disable:4786)
#include <SDL.h>
#include <glm/glm.hpp>

#include "../Vehicle.h"
#include "ArcanistGoalTypes.h"
#include "Goal.h"

class GoalSeekToPosition : public Goal<Vehicle> {
   private:
    // the position the bot is moving to
    glm::vec2 m_Position;

    // the approximate time the bot should take to travel the target location
    Uint32 m_TimeToReachPos;

    // this records the time this goal was activated
    Uint32 m_StartTime;

    // returns true if a bot gets stuck
    bool isStuck() const;

   public:
    GoalSeekToPosition(Vehicle* Bot, glm::vec2 target);

    // the usual suspects
    void Activate() override;
    int Process() override;
    void Terminate() override;

    void markOwnerWithGoal() override { m_Owner->m_Goal = m_Type; }
};