You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to C#, JS, and Python, we should allow collections to be initialized with values.
class Main
{
# Public variable should have a corresponding default array entry in Mode/Map editor veiw using JSON as the format.
ModeVariable = List();
# Second public variable uses a gameobject selector, on running, all gameobjects should be added to the list (or all ids if that prior isn't feasible).
@MultiGameObjectSelector
GameObjectVariable = List();
# Private variables can use initializers. (Use whatever version is picked from the Init function).
_privateVariable1 = List(['a', 'b', 'c']);
function Init()
{
# Implement one of the following versions of list initializers.
# version 1 syntactic sugar replaces [expr, expr, expr] with List(expr, expr, expr, ...) -> must modify list to have a secondary constructor that takes in objects
localVariable1 = ['a', 'b', 'c'];
localVariable2 = List(['a', 'b', 'c']);
# version 2 likely use syntactic sugar to replace List() { expr, expr, expr } with List(expr, expr, expr, ...) -> must modify list to have a secondary constructor that takes in objects
localVariable3 = List() { 'a', 'b', 'c' };
}
}
The text was updated successfully, but these errors were encountered:
Similar to C#, JS, and Python, we should allow collections to be initialized with values.
The text was updated successfully, but these errors were encountered: