Is there a “right” way of removing an element from a Dictionary?
In AS3, I would use the delete statement:
delete myDict[keyName];
In openfl, the Dictionary class doesn’t seem to have any sort of mechanism to remove an entry. Right now what I’m doing is, I assign null to a key. Unfortunately, this still means the entry “exists” and it comes up in for loops.
You can override the Dictionary class if you like. Put an openfl folder in your source directory, put a utils folder inside that, and make a class named Dictionary.hx. Then add this: