Open selkij opened 2 years ago
Dictionaries aren't fully supported as far as I know, at least I had problems as well.
Therefore I made a custom dictionary implementation which just uses 2 lists, it isn't fully-featured, standard-conforming or fast, but it should work. Multi-threading isn't a thing in Cosmos as of now anyway, but if it ever gets added, I would recommend not using this implementation anymore.
https://github.com/GoldenretriverYT/spaghettoOS/blob/main/spaghettoOS/Utils/CustomDict.cs TK (the Key type) has to inherit IComparable, which every Enum does. So it should, in theory, work.
Here is an example where I use my CustomDict: https://github.com/GoldenretriverYT/spaghettoOS/blob/main/spaghettoOS/Applications/ProcessManager.cs
Ill check that when I have time
After further debugging, it looks like this happens because System.Enum.GetHashCode() throws NotImplementedException.
Area of Cosmos - What area of Cosmos are we dealing with?
Dictionnarirs
Expected Behaviour - What do you think that should happen?
It should get the value from the key correctly
Actual Behaviour - What unexpectedly happens?
CPU exception Invalid OpCode
Reproduction - How did you get this error to appear?
Version - Were you using the User Kit or Dev Kit? And what User Kit version or Dev Kit commit (Cosmos, IL2CPU, X#)?
Devkit from last month I think? I dont have internet on my pc