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

Method setup_beforeAdd

packages/fairygui/src/widgets/GGraph.ts:286–321  ·  view source on GitHub ↗
(buffer: ByteBuffer, beginPos: number)

Source from the content-addressed store, hash-verified

284 }
285
286 public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {
287 super.setup_beforeAdd(buffer, beginPos);
288
289 buffer.seek(beginPos, 5);
290
291 this._type = buffer.readByte();
292 if (this._type !== EGraphType.Empty) {
293 this._lineSize = buffer.getInt32();
294 this._lineColor = buffer.readColorS(true);
295 this._fillColor = buffer.readColorS(true);
296 if (buffer.readBool()) {
297 this._cornerRadius = [];
298 for (let i = 0; i < 4; i++) {
299 this._cornerRadius[i] = buffer.getFloat32();
300 }
301 }
302
303 if (this._type === EGraphType.Polygon) {
304 const cnt = buffer.getInt16();
305 this._polygonPoints = [];
306 for (let i = 0; i < cnt; i++) {
307 this._polygonPoints[i] = buffer.getFloat32();
308 }
309 } else if (this._type === EGraphType.RegularPolygon) {
310 this._sides = buffer.getInt16();
311 this._startAngle = buffer.getFloat32();
312 const cnt = buffer.getInt16();
313 if (cnt > 0) {
314 this._distances = [];
315 for (let i = 0; i < cnt; i++) {
316 this._distances[i] = buffer.getFloat32();
317 }
318 }
319 }
320 }
321 }
322
323 public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {
324 super.setup_afterAdd(buffer, beginPos);

Callers

nothing calls this directly

Calls 7

readByteMethod · 0.80
getInt32Method · 0.80
readColorSMethod · 0.80
readBoolMethod · 0.80
getFloat32Method · 0.80
getInt16Method · 0.80
seekMethod · 0.65

Tested by

no test coverage detected