/*  $Id: event_listener_generic.cpp,v 1.9 2004/02/01 03:07:16 mbn Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
**
*/

#include "Core/precomp.h"
#include "event_listener_generic.h"
#include "event_trigger_generic.h"

/////////////////////////////////////////////////////////////////////////////
// CL_EventListener_Generic construction:

CL_EventListener_Generic::CL_EventListener_Generic(CL_EventListener *owner)
: owner(owner)
{
}

CL_EventListener_Generic::~CL_EventListener_Generic()
{
	clear();
}

/////////////////////////////////////////////////////////////////////////////
// CL_EventListener_Generic attributes:

/////////////////////////////////////////////////////////////////////////////
// CL_EventListener_Generic operations:

void CL_EventListener_Generic::add_trigger(const CL_EventTrigger *trigger)
{
	triggers.push_back(trigger->impl);
}

void CL_EventListener_Generic::remove_trigger(const CL_EventTrigger *trigger)
{
	triggers.remove(trigger->impl);
}

void CL_EventListener_Generic::clear()
{
	triggers.clear();
}

void CL_EventListener_Generic::reset_all()
{
	std::list< CL_SharedPtr<CL_EventTrigger_Generic> >::iterator it;
	for (it = triggers.begin(); it != triggers.end(); it++) (*it)->reset();
}

/////////////////////////////////////////////////////////////////////////////
// CL_EventListener_Generic implementation:
