text: /*
   * Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
   * 
   * SPDX-License-Identifier: Apache-2.0 OR MIT
   *
   */
  
  #pragma once
  
  #include "ComparisonFunctions.h"
  #include <Libraries/Core/BinaryOperator.h>
  
  namespace ScriptCanvas
  {
      namespace Nodes
      {
          namespace Comparison
          {
              class LessEqual
                  : public ComparisonExpression
              {
              public:
                  AZ_COMPONENT(LessEqual, "{73F6E302-A2E9-4BE6-A88F-98F81A24100D}", ComparisonExpression);
  
                  static void Reflect(AZ::ReflectContext* reflection)
                  {
                      if (AZ::SerializeContext* serializeContext = azrtti_cast<AZ::SerializeContext*>(reflection))
                      {
                          serializeContext->Class<LessEqual, ComparisonExpression>()
                              ->Version(0)
                              ;
  
                          if (AZ::EditContext* editContext = serializeContext->GetEditContext())
                          {
                              editContext->Class<LessEqual>("Less Than or Equal To (<=)", "Checks if Value A is less than or equal to Value B")
                                  ->ClassElement(AZ::Edit::ClassElements::EditorData, "")
                                      ->Attribute(AZ::Edit::Attributes::Icon, "Icons/ScriptCanvas/Placeholder.png")
                                      ->Attribute(AZ::Edit::Attributes::Visibility, AZ::Edit::PropertyVisibility::ShowChildrenOnly)
                                  ;
                          }
                      }
                  }
  
              protected:
                  Datum Evaluate(const Datum& lhs, const Datum& rhs) override
                  {
                      ComparisonOutcome result(lhs <= rhs);
                      
                      if (result.IsSuccess())
                      {
                          return Datum(result.GetValue());
                      }
                      else
                      {
                          SCRIPTCANVAS_REPORT_ERROR((*this), result.GetError().c_str());
                          return Datum(false);
                      }
                  }
              };
  
          }
      }
  }
  
  
  