Mod Creation/Mod Context API Reference: Difference between revisions

Line 861: Line 861:
// 2000 wood is available</nowiki>
// 2000 wood is available</nowiki>


==== PropertyPatch.replace(getter?: () => any, setter?: (value: any) => void): void ====
==== PropertyPatch.replace(getter?: (o: () => any) => any, setter?: (o: (value: any) => void, value: any) => void): void ====


Alias for calling <code>get</code> and <code>set</code> at the same time.
Alias for calling <code>get</code> and <code>set</code> at the same time.
Line 867: Line 867:
'''Parameters'''
'''Parameters'''


<code>getter: () => any</code> The getter function to be executed.
<code>getter: (o: () => any) => any</code> See above Parameters for <code>get</code>.


<code>setter: (value: any) => any</code> The getter function to be executed, with the <code>value</code> argument containing the value being set.
<code>setter: (o: (value: any) => void, value: any) => void</code> See above Parameters for <code>set</code>.


'''Example'''
'''Example'''
89

edits