𝐕𝐢𝐠𝐢𝐥
𝐕𝐢𝐠𝐢𝐥
CC#
Created by 𝐕𝐢𝐠𝐢𝐥 on 10/5/2023 in #help
❔ Dictionary and memory hijinks
I'm writing a console currently, I register objects that implement the IConVar interface exclusively, they can be registered from any class at any time for any reason that's needed. And if other classes wanna access them, they can (think of the UE4 console basically), the thing I'm scratching my head over right now is whether or not this type of function will return a copy, or just the object itself that was registered inside of another class previously (i.e, I make and instantiate a new object from a class implementing IConVar, register it to the Dictionary, will searching up the dictionary return that instance I used to register it into the dictionary, or will it return a brand new copy)
6 replies
CC#
Created by 𝐕𝐢𝐠𝐢𝐥 on 10/4/2023 in #help
❔ std::function-like var
Hey, I want to pass an function pointer (only void type) to a method which accepts generic arguments, I want to be able to basically store the reference to that function then call it on command. Not sure if this is way way too low level for C#, but it'd be pretty nice to have as an option, therefore, I have to ask if it's possible
5 replies
CC#
Created by 𝐕𝐢𝐠𝐢𝐥 on 10/4/2023 in #help
✅ "Object reference not set to an instance of"
Title, I use a Interface to allow me to make a list of objects that require generic arguments, one problem is that while I don't think anything is out of the ordinary, and I do instantiate new variables + objects attached to said variables (I do use Godot but it's more of a C# help, as these are bare bare objects), and once I try to cycle the list, bam all hell breaks loose, dropping attachments now
14 replies
CC#
Created by 𝐕𝐢𝐠𝐢𝐥 on 9/29/2023 in #help
❔ Function with generic argument as a setter
No description
27 replies