/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include "glmSDKAPI.h"
#include "glmAbstractUserBehavior.h"

namespace glm
{
    class PerceptionContext;
    class GLM_SDK_API ActivateSensorBehavior : public AbstractUserBehavior
    {
    public:
        glm::PODArray<int> _sensorIds;
        PerceptionContext* _perceptionContext;

    public:
        GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation);

        typedef SmartPointer<ActivateSensorBehavior> SP;

        ActivateSensorBehavior();
        virtual ~ActivateSensorBehavior();

        // type checking - value derived from this type
        virtual bool isThisType(const AbstractBehavior* value) const override;

    protected:
        // cloning
        friend class CloneFactory;
        inline virtual ActivateSensorBehavior* create() const override;

        /// \name glm::AbstractBehavior implementation
        ///@{
        virtual void doInit(BehaviorGraph& graph) override;
        virtual void doFinish(BehaviorGraph& graph) override;

        virtual void doStart(int64_t index, BehaviorGraph& graph) override;
        virtual ResultStatus::Value doStop(int64_t index, BehaviorGraph& graph, Time dt) override;
        ///@}
    };

    //-------------------------------------------------------------------------
    inline ActivateSensorBehavior* ActivateSensorBehavior::create() const
    {
        ActivateSensorBehavior* myNewActivateSensorBehavior = GLM_NEW(ActivateSensorBehavior, myNewActivateSensorBehavior, getClassMemoryStatId());
        return myNewActivateSensorBehavior;
    }
} // namespace glm
