namespace Salamander
{

template<class ReceiverType, class EventType>
void Events::receive(ReceiverType* receiver, void (ReceiverType::*function)(const EventType&))
{
	// Create a new receiver record
	EventReceiverRecord<EventType, ReceiverType>* eventReceiverRecord = new EventReceiverRecord<EventType, ReceiverType>;
	eventReceiverRecord->function_ = function;
	eventReceiverRecord->receiver_ = receiver;

	// Add to the head of the linked list
	eventReceiverRecord->nextReceiverRecord_ = firstReceiverRecord_;
	firstReceiverRecord_ = eventReceiverRecord;
}

}
