Commit 66280f79 authored by Thibaut Démare's avatar Thibaut Démare

Add the 'clear receivers' command

parent d917f604
......@@ -22,6 +22,7 @@ public class IKeywordGSAdditional implements IKeyword {
public static final String STEP = "gs_step";
//Receiver command
public static final String ADD_RECEIVER = "gs_add_receiver";
public static final String CLEAR_RECEIVERS = "gs_clear_receivers";
public static final String GET_EDGE_ATTRIBUTE = "gs_get_edge_attribute";
public static final String GET_NODE_ATTRIBUTE = "gs_get_node_attribute";
public static final String GET_GRAPH_ATTRIBUTE = "gs_get_graph_attribute";
......
package org.graphstream.gama.extension.receiver;
import msi.gama.precompiler.ISymbolKind;
import msi.gama.precompiler.GamlAnnotations.inside;
import msi.gama.precompiler.GamlAnnotations.symbol;
import msi.gama.runtime.IScope;
import msi.gama.runtime.exceptions.GamaRuntimeException;
import msi.gaml.descriptions.IDescription;
import msi.gaml.statements.AbstractStatement;
import msi.gaml.statements.IStatement;
import org.graphstream.gama.extension.GSManager;
import org.graphstream.gama.extension.IKeywordGSAdditional;
@symbol(name = IKeywordGSAdditional.CLEAR_RECEIVERS, kind = ISymbolKind.SINGLE_STATEMENT, with_sequence = false)
@inside(kinds = { ISymbolKind.BEHAVIOR, ISymbolKind.SINGLE_STATEMENT })
public class ClearReceiversStatement extends AbstractStatement implements IStatement{
public ClearReceiversStatement(IDescription desc) {
super(desc);
}
@Override
protected Object privateExecuteIn(IScope scope) throws GamaRuntimeException {
GSManager.clearReceivers();
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment