MCPcopy Index your code
hub / github.com/4ian/GDevelop / removeLinkBetween

Method removeLinkBetween

Extensions/LinkedObjects/linkedobjects.ts:140–161  ·  view source on GitHub ↗
(objA: gdjs.RuntimeObject, objB: gdjs.RuntimeObject)

Source from the content-addressed store, hash-verified

138 }
139
140 removeLinkBetween(objA: gdjs.RuntimeObject, objB: gdjs.RuntimeObject) {
141 if (this._links.has(objA.id)) {
142 const map = this._links.get(objA.id)!.linkedObjectMap;
143 if (map.has(objB.getName())) {
144 const list = map.get(objB.getName())!;
145 const index = list.indexOf(objB);
146 if (index !== -1) {
147 list.splice(index, 1);
148 }
149 }
150 }
151 if (this._links.has(objB.id)) {
152 const map = this._links.get(objB.id)!.linkedObjectMap;
153 if (map.has(objA.getName())) {
154 const list = map.get(objA.getName())!;
155 const index = list.indexOf(objA);
156 if (index !== -1) {
157 list.splice(index, 1);
158 }
159 }
160 }
161 }
162
163 clearAllLinks() {
164 this._links.clear();

Callers 2

removeLinkBetweenFunction · 0.80
doTestFunction · 0.80

Calls 3

getMethod · 0.65
getNameMethod · 0.65
hasMethod · 0.45

Tested by 1

doTestFunction · 0.64