goated
goated
CC#
Created by goated on 2/17/2024 in #help
is there any sort of friend operator in c++ in c#?
.
5 replies
CC#
Created by goated on 2/15/2024 in #help
I'm confused what IDisposable is used for
So I was expecting once the code run out of the using {} the class would be destroyed (and if we try to access it will throw a null ref exception)therefore helping the system, but it turns out if I keep a reference to it it wouldn't be destroyed, which means it's going to check is there any reference to the object anyways, it's not going to optimize the code right? Using a normal class and disposable feels the same
9 replies
CC#
Created by goated on 2/12/2024 in #help
how to use attribute to get functions and store in dict?
i want to store all functions with attribute from a specific instance of class(verifyHandler) to the dict i tried to code with the help of gpt and im having some troubles idk much about reflection so idk how to fix public void VerifyMethods() { System.Type targetType = typeof(verifyHandler); MethodInfo[] methods = targetType.GetMethods(BindingFlags.Instance | BindingFlags.Public); foreach (MethodInfo method in methods) { verifyAttribute verifyAttribute = (verifyAttribute)System.Attribute.GetCustomAttribute(method, typeof(verifyAttribute)); if (verifyAttribute != null) { System.Func<JoinRequestMessage, bool> func = (System.Func<JoinRequestMessage, bool>)System.Delegate.CreateDelegate(typeof(System.Func<JoinRequestMessage, bool>),method,verifyhandler); JoinFailedCallback callback = verifyAttribute.callbackmsg; checkers.Add(func, callback); } } Debug.Log($"checkers(count):{checkers.Count}"); }
4 replies
CC#
Created by goated on 1/15/2024 in #help
I need some help with attribute
Welp I don't know much about attribute and GPT keeps sending me s*** code Anyone can give me an example on how to do this: When we call a function with a attribute [timerTest] It will print out how long does the function runs
18 replies
CC#
Created by goated on 12/31/2023 in #help
anyone knows how to createa shortcut to the target program?
I'm also hoping this is doable without using third party libraries
4 replies