annotations
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
annotations [2021/12/06 14:23] – created maxime | annotations [2022/08/16 10:56] (current) – maxime | ||
---|---|---|---|
Line 8: | Line 8: | ||
<code lua> | <code lua> | ||
- | mod:createData({ | + | foundation.createData({ |
DataType = " | DataType = " | ||
ResourceNeededList = { -- list of RESOURCE_COLLECTION_VALUE | ResourceNeededList = { -- list of RESOURCE_COLLECTION_VALUE | ||
Line 27: | Line 27: | ||
} | } | ||
}) | }) | ||
+ | </ | ||
+ | |||
+ | === Lazy-init === | ||
+ | |||
+ | By default, components are always initialized (call of '' | ||
+ | |||
+ | <code lua> | ||
+ | local standardComp = nil | ||
+ | local lazyInitComp = nil | ||
+ | |||
+ | level: | ||
+ | standardComp = _newObject: | ||
+ | standardComp: | ||
+ | | ||
+ | lazyInitComp = _newObject: | ||
+ | lazyInitComp: | ||
+ | end) | ||
+ | -- at the end of createObject, | ||
+ | |||
+ | -- when enabling lazyInitComp, | ||
+ | lazyInitComp: | ||
+ | </ | ||
+ | |||
+ | === Cloneable === | ||
+ | |||
+ | Instance of types flagged as '' | ||
+ | |||
+ | When extending a cloneable type, this new type will also be cloneable. All properties of the parent type will be cloned by default, but you'll have to implement the '' | ||
+ | |||
+ | <code lua> | ||
+ | local MY_CUSTOM_MANDATE = { | ||
+ | TypeName = " | ||
+ | ParentType = " | ||
+ | Properties = { | ||
+ | { Name = " | ||
+ | { Name = " | ||
+ | { Name = " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function MY_CUSTOM_MANDATE: | ||
+ | self.MyFloat = _source.MyFloat | ||
+ | self.MyString = _source.MyString | ||
+ | self.MyBuildingProgress = _source.MyBuildingProgress: | ||
+ | end | ||
+ | |||
+ | mod: | ||
</ | </ | ||
annotations.txt · Last modified: 2022/08/16 10:56 by maxime