From b275628cbf494369a1357287286ef939043d6a8c Mon Sep 17 00:00:00 2001 From: Ezekiel Date: Thu, 4 Jul 2024 17:30:12 -0700 Subject: [PATCH] feat: document lazy systems and parameters --- src/app/docs/lang/lang.component.html | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/app/docs/lang/lang.component.html b/src/app/docs/lang/lang.component.html index 910d3d7c..b5b3027b 100644 --- a/src/app/docs/lang/lang.component.html +++ b/src/app/docs/lang/lang.component.html @@ -43,6 +43,30 @@

Syntax

*/ +

Parameters

+

+ Statements may optionally have parameters. Parameters start with + the ( 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
+	
+ +

+ 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

Top level statements are separated into 3 sections.

    @@ -239,6 +263,7 @@

    Actions

    {{'}'}} +

    Anonymous Systems

    Systems that have a @@ -262,6 +287,26 @@

    Anonymous Systems

    directly during system execution.

    +

    Lazy Systems

    +

    + 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;
    +			{{'}'}}
    +		{{'}'}}
    +	
    +

    Fields

    Both components and actions may contain any number of fields

    Field Types