From b275628cbf494369a1357287286ef939043d6a8c Mon Sep 17 00:00:00 2001
From: Ezekiel
+ Statements may optionally have parameters. Parameters start with
+ the
+ Parameters are part of the syntax of the Ecsact language, but that doesn't
+ mean all statements allow all parameters. It is an error to give a statement
+ a parameter it does not support.
+ Top level statements are separated into 3 sections.
Systems that have a
@@ -262,6 +287,26 @@ Syntax
*/
+ Parameters
+ (
character and end with the )
character.
+ Each parameter has a name
and a value
.
+
+
+
+ // statement with 1 parameter
+ statement(name: value);
+
+ // parameters are allowed on block statements as well
+ statement(name: value, name_two: value_two) {{'{}'}}
+
+ statement(name); // 'value' is `true` because it was ommitted
+ statement(name: true); // this is equivalent to the above
+
Top Level Statements
@@ -239,6 +263,7 @@
Actions
{{'}'}}
+
Anonymous Systems
Anonymous Systems
directly during system execution.
+ Systems can be marked as lazy with the lazy
+ parameter.
+ The lazy
parameter accepts an integer or a boolean as a value.
+ The value of the parameter determines how many times a system implementation
+ may be executed. A value of false
or 0
means the
+ system is not lazy. A value of true
means 1
.
+
+ // Run this expensive system at most 50 times per execution
+ system(lazy: 50) {{'{'}}
+ readwrite CollisionBox;
+ system ExpensiveSystem {{'{'}}
+ readwrite CollisionBox;
+ adds Colliding;
+ {{'}'}}
+ {{'}'}}
+
+
Both components and actions may contain any number of fields