This file contains hidden or 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
// (example prompt, hardcoded array value generarted by AI successfully given starting array values of "[0, 1, 5..." | |
const quadTreeArrayLevelOffsets: Array<number> = [0, 1, 5, 21, 85, 341, 1365, 5461, 21845, 87381, 349525, 1398101, 5592405, 22369621, 89478485, 357913941, 1431655765, 5726623061, 22906492245, 91625968981, 366503875925, 1466015503701, 5864062014805, 23456248059221, 93824992236885, 375299968947541, 1501199875790165, 6004799503160661, 24019198012642645, 96076792050570581, 384307168202282325, 1537228672809129301, 6148914691236517205, 24595658764946068821, 98382635059784275285, 393530540239137101141, 1574122160956548404565, 6296488643826193618261, 25185954575304774473045, 100743818301219097892181, 402975273204876391568725, 1611901092819505566274901, 6447604371278022265099605, 25790417485112089060398421, 103161669940448356241593685, 412646679761793424966374741, 1650586719047173699865498965, 6602346876188694799461995861, 26409387504754779197847983445, 105637550019019116791391933781, 422550200076076467 |
This file contains hidden or 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
/** | |
* @param callback Important: A *Memomized* callback reference (eg. via `useCallback()`) or a *Permanent* function | |
* to process/return a given lazy initialized state! | |
* State will re-update on next frame via useEffect if callback method supplied is different from previous case, | |
* but on subsequent renders only. | |
* @returns The state payload consisting of [state, setState] | |
*/ | |
export function useStateByCallback<T>(callback: () => T) { | |
const payload = useState(callback); | |
const [, setVal] = payload; |
This file contains hidden or 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
/** | |
* useEffect() that skips the first render execution before being mounted | |
* @param callback Important: A *Memomized* callback reference (eg. via `useCallback()`) or any other function | |
* to process/return a given lazy initialized state! eg. `usePostEffect(useCallback(.., [...]))` | |
* Callback will call again on next frame via useEffect() if callback method supplied is different from previous case, | |
* but on subsequent renders only. | |
*/ | |
export function usePostEffect(callback: Function) { | |
const ref = useRef(false); | |
useEffect(() => { |
This file contains hidden or 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
_callComponentMethod: function (name, dt) { | |
var wasLooping = this._beginLooping(); | |
var nextN; | |
var lastN = null; | |
for (var n = this.compNodeList; n!=null; n=nextN) { | |
nextN = n.next; | |
var c = n.c; | |
if (c._destroyed || !c.entity.enabled || !c.enabled) { | |
if (lastN) { | |
lastN.next = nextN; |
This file contains hidden or 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
SONG OF SWORDS: Character Creation UI Field formulas (for Beta 2.0) | |
/* | |
PSEUDO CODE LEGEND SUMMARY: | |
* instance field quantifier/process description | |
"the" - single/sole/final, etc. | |
"each" - for each, resolves to different results per instance | |
"all" - for all instances, resolves similarly across all instances | |
=> Direct instance implication/continuation (ie. holds internal field) | |
|=> per instance respective field value implication (1 to 1 relationships) |