luxe: system/values.modifier
import "luxe: system/values.modifier" for Datano docs found
Variables
Section titled “Variables”var values : List = []import "luxe: system/values.modifier" for Valueno docs found
Variables
Section titled “Variables”var kind : ValuesKind = ValuesKind.numbervar name : String = "value"var number : Num = 0var string : String = ""var boolean : Bool = falsevar float2 : Float2 = [0, 0]var float3 : Float3 = [0, 0, 0]var float4 : Float4 = [0, 0, 0, 0]var color : Color = [1, 1, 1, 1]Values
Section titled “Values”import "luxe: system/values.modifier" for ValuesValues is a modifier that lets you store Key -> Value pairs. Store values like numbers, strings, and colors on an entity, which can then be accessed by name (a Key).
//we can use an enum for keysclass Keys {static watered { "watered" }static apples { "apples" }}var tree = Entity.create(world)Values.create(tree)Values.set(tree, Keys.watered, true)Values.set(tree, Keys.apples, 10)Values.set(tree, "keys are strings", true)var watered = Values.get(tree, Keys.watered, false)var apples = Values.get(tree, Keys.apples, -1)Log.print("The tree is %(watered ? "watered" : "thirsty") and has %(apples) apples!")
Values.create(.)
Section titled “Values.create(.)”Values.create(entity : Entity) : NoneAttach a
Valuesmodifier toentity.var entity = Entity.create(world)Values.create(entity)
Values.destroy(.)
Section titled “Values.destroy(.)”Values.destroy(entity : Entity) : NoneDetach and destroy the
Valuesattached toentityValues.destroy(entity)
Values.has(.)
Section titled “Values.has(.)”Values.has(entity : Entity) : BoolReturns true if
entityhas aValuesmodifier attached.if(Values.has(entity)) {Log.print("Has a Values modifier!")}
Values.has_key(..)
Section titled “Values.has_key(..)”Values.has_key(entity : Entity, key : String) : BoolReturns true the entity’s Values modifier has a value with the given ‘key’
if(Values.has_key(entity, "apples")) {Log.print("The tree has some apples!")}
Values.remove_key(..)
Section titled “Values.remove_key(..)”Values.remove_key(entity : Entity, key : String) : NoneRemoves a value by key from ‘entity’s Values modifier, if it exists
Values.remove_key(tree, "apples")
Values.get_keys(.)
Section titled “Values.get_keys(.)”Values.get_keys(entity : Entity) : ListGet a List of all the String keys for values on ‘entity’s Values modifier
var keys = Values.get_keys(grass)for (key in keys) {Log.print("Has Value Key: %(key)")}
Values.get(…)
Section titled “Values.get(…)”Values.get(entity : Entity, key : String, default : Any) : AnyGet the current value stored with
keyon the Values modifier onentity, with a default value which is returned if the key isn’t found.var seeds = Values.get(watermelon, "seeds", 0)Log.print("The watermelon has %(seeds) seeds!")
Values.set(…)
Section titled “Values.set(…)”Values.set(entity : Entity, key : String, value : Any) : NoneSet the value stored at the ‘key’ on the Values modifier on ‘entity’.
if(Values.has(seed)) {Values.set(seed, "planted", true)}
ValuesKind
Section titled “ValuesKind”import "luxe: system/values.modifier" for ValuesKindno docs found
ValuesKind.number
Section titled “ValuesKind.number”ValuesKind.number : unknownno docs found
ValuesKind.string
Section titled “ValuesKind.string”ValuesKind.string : unknownno docs found
ValuesKind.boolean
Section titled “ValuesKind.boolean”ValuesKind.boolean : unknownno docs found
ValuesKind.float2
Section titled “ValuesKind.float2”ValuesKind.float2 : unknownno docs found
ValuesKind.float3
Section titled “ValuesKind.float3”ValuesKind.float3 : unknownno docs found
ValuesKind.float4
Section titled “ValuesKind.float4”ValuesKind.float4 : unknownno docs found
ValuesKind.color
Section titled “ValuesKind.color”ValuesKind.color : unknownno docs found
ValuesType
Section titled “ValuesType”import "luxe: system/values.modifier" for ValuesTypeno docs found
ValuesType.unknown
Section titled “ValuesType.unknown”ValuesType.unknown : unknownno docs found
ValuesType.bool
Section titled “ValuesType.bool”ValuesType.bool : unknownno docs found
ValuesType.number
Section titled “ValuesType.number”ValuesType.number : unknownno docs found
ValuesType.string
Section titled “ValuesType.string”ValuesType.string : unknownno docs found
ValuesType.float2
Section titled “ValuesType.float2”ValuesType.float2 : unknownno docs found
ValuesType.float3
Section titled “ValuesType.float3”ValuesType.float3 : unknownno docs found
ValuesType.float4
Section titled “ValuesType.float4”ValuesType.float4 : unknownno docs found
ValuesType.name(.)
Section titled “ValuesType.name(.)”ValuesType.name(value : Any) : unknownno docs found