ICT290 / src / scene / AIController / Goals / GoalDodgeSideToSide.h
GoalDodgeSideToSide.h
Raw
#pragma once
//#pragma warning (disable:4786)
//-----------------------------------------------------------------------------
//
//  Name:   GoalDodgeSideToSide.h
//
//  Author: Mat Buckland (ai-junkie.com)
//
//  Desc:   this goal makes the bot dodge from side to side
//
//-----------------------------------------------------------------------------
#include "../Vehicle.h"
#include "ArcanistGoalTypes.h"
#include "Goal.h"

class GoalDodgeSideToSide : public Goal<Vehicle> {
   private:
    glm::vec2 m_StrafeTarget;

    bool m_Clockwise;

    glm::vec2 GetStrafeTarget() const;

   public:
    explicit GoalDodgeSideToSide(Vehicle* Bot)
        : Goal<Vehicle>(Bot, goal_strafe),
          m_Clockwise(rand() % 2){};

    void Activate() override;

    int Process() override;

    void Terminate() override;

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