#pragma once
#include "../../../../Utils/Process/FSM/Condition.h"

template <class UnitGroup>
class AllPickedUp : public Condition
{
public:
  AllPickedUp(const UnitGroup& unitToPick)
    : m_unitToPick(unitToPick)
  {
  }

  bool evaluate() const
  {
	  //m_unitToPick->holdPosition();
    // m_unitToPick->end();
    for(UnitGroup::const_iterator i = m_unitToPick.begin();
        i != m_unitToPick.end();
        ++i)
    {
      if(!(*i)->isLoaded())
	    {
        return false;
	    }
    }
    return true;
  }

protected:
  const UnitGroup& m_unitToPick;

private:

  //const member prevent the use of the assigment operator
  AllPickedUp& operator= (const AllPickedUp&);

};