MCPcopy Create free account
hub / github.com/esengine/esengine / readItems

Method readItems

packages/fairygui/src/widgets/GList.ts:669–691  ·  view source on GitHub ↗
(buffer: ByteBuffer)

Source from the content-addressed store, hash-verified

667 }
668
669 protected readItems(buffer: ByteBuffer): void {
670 const cnt = buffer.getInt16();
671 for (let i = 0; i < cnt; i++) {
672 const nextPos = buffer.getInt16() + buffer.position;
673
674 let str = buffer.readS();
675 if (!str) {
676 str = this._defaultItem;
677 if (!str) {
678 buffer.position = nextPos;
679 continue;
680 }
681 }
682
683 const obj = this.getFromPool(str);
684 if (obj) {
685 this.addChild(obj);
686 this.setupItem(buffer, obj);
687 }
688
689 buffer.position = nextPos;
690 }
691 }
692
693 protected setupItem(buffer: ByteBuffer, obj: GObject): void {
694 let str = buffer.readS();

Callers 1

setup_beforeAddMethod · 0.95

Calls 5

getFromPoolMethod · 0.95
setupItemMethod · 0.95
getInt16Method · 0.80
readSMethod · 0.80
addChildMethod · 0.45

Tested by

no test coverage detected