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

#pragma once

#include "glmAbstractBehavior.h"
#include "glmSmartPointer.h"

namespace glm
{
    class GLM_SDK_API InitialBehaviorOperator : public AbstractBehavior
    {
    public:
        GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation)

        InitialBehaviorOperator();
        virtual ~InitialBehaviorOperator();

        inline virtual bool isTimeConsuming() const override;

        virtual void init(BehaviorGraph& graph) override;
        virtual void update(int64_t index, BehaviorGraph& graph, Time dt) override;
        virtual void requestStart(int64_t index, BehaviorGraph& graph) override;

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

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

    //-------------------------------------------------------------------------
    inline bool InitialBehaviorOperator::isTimeConsuming() const
    {
        return false;
    }

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