//
// Copyright (c) 2009 Froduald Kabanza and the Université de Sherbrooke.
// Use of this software is permitted for non-commercial research purposes, and
// it may be copied or applied only for that use. All copies must include this
// copyright message.
// 
// This is a research prototype that has not gone through intensive tests and
// is delivered as is. It may still contain bugs. Froduald Kabanza and the
// Université de Sherbrooke disclaim any responsibility for damage that may be
// caused by using it.
//
// Please note that some files were inspired in part by the PDDL4J library:
// http://www.math-info.univ-paris5.fr/~pellier/software/software.php 
//
// Implementation: Simon Chamberland
// Project Manager: Froduald Kabanza
//

#ifndef _I_GROUND_ACTION_H
#define _I_GROUND_ACTION_H

#include "../../Utils/ReferenceCounted.h"
#include "../World/IDurativeClosedWorld.h"
#include "../Exp/IEffect.h"
#include "../Exp/Term/Object.h"
#include "ActionContext.h"

#include <vector>

namespace planning
{
  /// <summary>
  /// This interface is implemented by all types of action defined in the PDDL language.
  /// </summary>
  class IGroundAction : public ReferenceCounted
  {
  public:
    virtual ~IGroundAction() {}

    virtual bool isApplicable(const IClosedWorld* world) const = 0;

    virtual const IEffect* getStartEffect() const = 0;

    virtual void getDelayedEffects(const IClosedWorld* evaluationWorld, 
                                   std::vector<std::pair<double, const IEffect*>>& delayedEffects) const = 0;

    //virtual void evaluateAtStart(const IClosedWorld* world, ActionContext* context) const = 0;
    //virtual bool evaluateOverAll(const IClosedWorld* world, ActionContext* context) const = 0;
    //virtual bool evaluateAtEnd(const IClosedWorld* world, ActionContext* context) const = 0;

  protected:
    ///// <summary>
    ///// Returns the name of the action.
    ///// </summary>
    //string Name { get; }

    ///// <summary>
    ///// Returns the priority of the action. A higher priority means the action will be chosen
    ///// first. Defining priorities is possible only in TLPlan domains.
    ///// </summary>
    //[TLPlan]
    //double Priority { get; }

    ///// <summary>
    ///// Returns all effects of the action, independently of their time of effect.
    ///// </summary>
    ///// <returns>All effects of the action.</returns>
    //IEnumerable<IEffect> GetAllEffects();

    ///// <summary>
    ///// Returns the parameters of the action.
    ///// </summary>
    ///// <returns>The parameters of the action.</returns>
    //IEnumerable<ObjectParameterVariable> GetParameters();

    ///// <summary>
    ///// Returns a typed string representation of this action.
    ///// </summary>
    ///// <returns>A typed string representation of this action.</returns>
    //string ToTypedString();
  };
}

#endif