-
-
Notifications
You must be signed in to change notification settings - Fork 237
/
Command.scala
34 lines (29 loc) · 1.4 KB
/
Command.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// (C) Uri Wilensky. https://github.com/NetLogo/NetLogo
package org.nlogo.api
/**
* Interface for NetLogo extension commands. Commands are primitives that
* do not return a value. All new commands must implement this interface.
*/
trait Command extends Primitive {
/**
* Specifies whether NetLogo should "switch" to another turtle after running this command.
* Generally, this should be true if this <code>Command</code> affects the state of the world
* (changing a variable, changing graphics, etc.)
*
* @return <code> true </code> if a switch should occur, <code> false </code> otherwise.
*/
def getSwitchesBoolean: Boolean
/**
* Executes this <code>Command</code>. Called by NetLogo when this <code>Command</code> is called at run-time.
*
* @param args the <code>Argument</code>s that were passed to
* the command. (May be a <code>Reporter</code> or a constant.)
* To evaluate arguments, use the typesafe methods in the <code>Argument</code> interface.
* @param context the current <code>Context</code> allows access to NetLogo internal methods
* @throws ExtensionException (if an extension-related problem occurs)
* @throws LogoException (if one of the evaluated arguments throws a LogoException)
*/
@throws(classOf[ExtensionException])
@throws(classOf[LogoException])
def perform(args: Array[Argument], context: Context)
}