Flexible Rules
Home Publications Examples Downloads API Overview API Doc Tutorials

API Overview

append element Appends the element element to the list list.
binary operator Arithmetic and logic binary operators.
break Exits the current control structure.
change state to Sets the current state of the entity to state.
choose Returns a random element from the list list.
clear Clears the graphic named name, resp. clear all the graphics contained in the template template.
close checkpoint Commits changes that occured since the last opened checkpoint (rollback to this checkpoint is no longer possible).
comment Puts all the arguments (expr1, expr2, ..., exprN) in a comment. These expressions are not executed.
compare Compare two lists or dictionary and returns true if they are equal and nil otherwise.
concat Concatenate multiple elements into a single string.
const Returns the value of the global constant const.
contains Returns non nil if the list list contains the element element.
debug Prints the string string on the default outputstream, along with the name of the entity executing the debug command.
dict Creates a dictionary i.e. a list of string keys associated to values.
disable automatic display update Disables display updates that are automatically fired after the execution of any representation's behavior.
do ... end Allows to group expr1, expr2, ..., exprN in a single statement.
draw Draws the graphics stored in graphic properties. Optionally a new position position and a new name name can be specified. If graphic properties contains multiple graphics the new name is ignored.
element at Returns the element at index position from the list list of the current entity, resp. of the entity entity.
enable automatic display update Enables display updates after the execution of any representation's behavior and forces an update.
entities of type Returns the list of all the entities of the type model.
entities with property Returns the list of all the entities of the game which have the value of property property equal/not equal to value.
equal? Returns non nil if the the two elements are equals. Lists containing the same elements but in different order will return nil. If you need to check if two list contains the same elements but you don't care about the ordering use compare.
figure Returns the dictionary containing the properties of the figure id in template template.
figure group Returns the dictionary containing the figures of group group in template template.
figure template Returns the dictionary containing the graphic templates contained in template file. The template file can be selected through a combo box showing the defined figure templates. A more advanced mode of operation is available by clicking on the block label, which allows to define complex template names. It is possible to toggle between the two modes of operation by clicking on the block label.
first Returns the first element of the list list.
foreach For each value within the list list list execute the statement statement .
forward message to Forwards the received message to the entity entity. Optionally a dictionary of parameters can be added.
haskey? Returns non nil if the dictionary dict contains the key key, otherwise returns nil.
if If a certain condition condition is met (evaluated to true) executes statement statement1, otherwise executes statement statement2.
inform Every time the property prop updates its value a message labeled label is sent to the entity entity. The new value can be accessed using (newvalue).
init display Initializes the display in full screen mode.
init display as in Initializes the display according to the graphics template template.
init from Initializes the current entity according to the template template.
init undo Initializes the storage used within the undo/redo service.
insert Inserts the element element at the index position in the list list of the current entity, resp. of the entity entity and returns the modified list.
keys Returns the list of keys of the dictionary dict.
last Returns the last element of the list list.
len Returns the size of the list list.
link Links a key key to a value value in a dictionary dict, resp. in a dictionary stored as a property prop in the current entity or in the entity entity.
list Creates a list.
load game Opens a dialog window asking for the file containing the saved game to load and resume.
logic name When called within a representation returns the name of the logical counterpart.
logic property Lets a representation entity access the property prop of its logical counterpart
logic template Returns all the logic information needed to initialize the game entities that are stored in the file at path.
match Retrieves the value associated to the key key in the dictionary dict, resp. in the dictionary stored in the property prop of the current entity or of the entity entity.
maximum undo steps Sets the maximum amount of undo steps that can be performed. Typically 64.
message attribute Returns the value of the message attribute attribute, resp. stores it in var. The sender of the message is stored within the attribute sender which is automatically set by the system.
new const Defines a new global constant accessible by all the entities.
new entity Creates a new logical entity named name as an instance of the model model.
new entity with repr Creates a new logical entity named name as an instance of the model model, along with its graphical counterpart name.repr.
new property Initializes a new local property property to the nil value, resp. to value.
new var Defines a temporary variable name with value value. Variables can be retrieved by means of their name.
newvalue Returns the new value of the observed property.
nil nil is the default false value.
not Returns the logical negation of the expression expr. All the values different from nil are interpreted as true.
number Number.
observe property Observes the property prop of the underlying logical entity. When this property is modified a message labeled label is fired. The new value of prop can be accessed using (newvalue).
on rollback notify If a rollback occours notify the entity entity with the message message.
open checkpoint Creates a snapshot of the current global state of the game, that can be reverted to by means of a rollback.
placeholder Returns the position (a list containing the "x" and "y" coordinates) of the placeholder placeholder name in template template.
property Returns the value of the local property prop. Returns the value of the property property of the entity entity.
range Returns a list of munbers starting from start and ending with end.
redo Performs a redo to the last move, i.e. reverts to the next available undo point.
remove element Removes the element element from the list list from the current entity, resp. from the entity entity, and returns the new list.
remove element at Removes the element at the index position from the list list and returns the new list.
remove key Removes the key key from the dictionary dict, resp. from the dictionary stored in the property prop and returns the new dictionary.
representation name When called within a logical entity returns the name of the dual representation.
return Terminates the execution of the current behavior and returns value to the message sender.
revertState Reverts to the last state.
rollback Fires the rollback notification and reverts the global state of the game to the current snapshot.
rollback reason Fires the rollback notification including the attribute reason as reason and then reverts the global state of the game to the current snapshot.
rotate Returns a list where the first element of list list is removed from the first position and put at the end.
save game Opens a dialog window asking for the file where you want to save the current state of the game.
self Returns the name of the current entity.
send new delayed message Creates a new message with label label and sends it to the entity recipient after delay milliseconds.
send new message Creates a new message with label label and sends it to the entity recipient. Optionally a dictionary of parameters can be added.
send new non blocking message Creates a new non blocking message (do not wait for a reply) with label label and sends it to the entity recipient.
set var Sets the new value of the temporary variable name to value.
skip Jumps to the end of the current behavior or law or side-effect.
sleep Sleep for time milliseconds.
string Anything within quotation marks is interpreted as a string.
switch If expression is equal to expressionK execute statementK.
undo Perform an undo to the last available undo point.
undo point Sets an undo point, i.e. stores the current situation.
update display Forces a display update. All the changes will be executed.
update figure Sets the attibute attribute of figure id to the new value value. Defined attributes are: image : sets an image within the panel (remove image by setting "image" to nil) ; text : sets a text within the panel.
update message attribute Updates the message attribute attribute to the value value.
update property Updates the value of the property property to value.
wait signal Waits until the signal tag is emitted. If a payload is emitted with the signal it is returned to the caller (typically for storin in a variable or to switch).
while While the expression is evaluated to true execute the statement.


Contact: Fulvio Frapolli (fulvio . frapolli //at// gmail . com), Amos Brocco (amos . brocco //at// gmail . com)
* Remove spaces and replace //at// with @
© 2009