-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added bool to number function expression * added group attribute to cell entities * added neighbors attribute to group entities * updated modding guide a bit more * more modding guide updates * Update entities_guide.md * more guide updates * more guide updates * more modding guide updates * final modding guide update
- Loading branch information
Showing
36 changed files
with
905 additions
and
843 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ts/Scripts/WorldEngine/Modding/Expressions/NumericExpressions/NumberFunctionExpression.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using UnityEngine; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Text.RegularExpressions; | ||
|
||
public class NumberFunctionExpression : FunctionExpressionWithOutput<float> | ||
{ | ||
public const string FunctionId = "number"; | ||
|
||
private readonly IValueExpression<bool> _arg; | ||
|
||
public NumberFunctionExpression(Context c, IExpression[] arguments) : | ||
base(c, FunctionId, 1, arguments) | ||
{ | ||
_arg = ValueExpressionBuilder.ValidateValueExpression<bool>(arguments[0]); | ||
} | ||
|
||
public override float Value => _arg.Value ? 1 : 0; | ||
} |
11 changes: 11 additions & 0 deletions
11
...ripts/WorldEngine/Modding/Expressions/NumericExpressions/NumberFunctionExpression.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.