mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-19 14:13:48 +01:00
Fix stanek leaking classes
This commit is contained in:
parent
8f3fc22ae6
commit
fda3f02d73
@ -68,13 +68,7 @@ export class ActiveFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
copy(): ActiveFragment {
|
copy(): ActiveFragment {
|
||||||
// We have to do a round trip because the constructor.
|
return Object.assign({}, this);
|
||||||
const fragment = FragmentById(this.id);
|
|
||||||
if (fragment === null) throw new Error("ActiveFragment id refers to unknown Fragment.");
|
|
||||||
const c = new ActiveFragment({ x: this.x, y: this.y, rotation: this.rotation, fragment: fragment });
|
|
||||||
c.highestCharge = this.highestCharge;
|
|
||||||
c.numCharge = this.numCharge;
|
|
||||||
return c;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -76,13 +76,7 @@ export class Fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
copy(): Fragment {
|
copy(): Fragment {
|
||||||
return new Fragment(
|
return Object.assign({}, this);
|
||||||
this.id,
|
|
||||||
this.shape.map((a) => a.slice()),
|
|
||||||
this.type,
|
|
||||||
this.power,
|
|
||||||
this.limit,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user