define(['dispatcher', 'model/drifter'], function(Dispatcher, DrifterModel){
	var _add = function(lat, lon){
		Dispatcher.dispatch({'action': 'add-drifter', 'data': new DrifterModel(lat, lon, 'wait')});
	}

	var _remove = function(drifter){
		Dispatcher.dispatch({'action': 'remove-drifter', 'data': drifter});
		if(drifter.getStatus !== 'wait') Dispatcher.dispatch({'action': 'remove-trajectory', 'data': drifter});
	}

	var _clear = function(){
		Dispatcher.dispatch({'action': 'clear-drifters', 'data': {}});
	}

	return {
		add: _add,
		remove: _remove,
		clear: _clear
	}
});