Thinker
Thinker
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
That's a fundamental universal truth of C#
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
If a method takes a Dictionary<int, string> then it can only take a Dictionary<int, string>
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
We're not banging stones together, we're not Python
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
The compiler does that for you
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
You don't need to do these kinds of type checks yourself, ever
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
Just do this
public void YourMethod<TKey, TValue>(Dictionary<TKey, TValue> dict)
{
// ...
}
public void YourMethod<TKey, TValue>(Dictionary<TKey, TValue> dict)
{
// ...
}
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
Yeah so... why?
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
wait no
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
I misread
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
oh
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
Although if you already know that dict is a dictionary, why do you need this?
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
dict.GetType().GetGenericTypeDefinition() == typeof(Dictionary<,>)
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
On the type of the dictionary
30 replies
CC#
Created by UnemployedNinja on 2/25/2024 in #help
Check if an object is a Dictionary of any type
You need to check whether GetGenericTypeDefinition() returns typeof(Dictionary<,>)
30 replies
CC#
Created by MENN | Kaiju on 2/23/2024 in #help
help me
VS vs. VSCode is very decisive
52 replies
CC#
Created by MENN | Kaiju on 2/23/2024 in #help
help me
Arguments
52 replies
CC#
Created by MENN | Kaiju on 2/23/2024 in #help
help me
@Kaiju Tl;dr, just install Visual Studio, not Code.
52 replies
CC#
Created by MENN | Kaiju on 2/23/2024 in #help
help me
Although with Unity, none of those are really a necessity
52 replies
CC#
Created by MENN | Kaiju on 2/23/2024 in #help
help me
Yeah but not all beginners will be comfortable with the command line
52 replies
CC#
Created by MENN | Kaiju on 2/23/2024 in #help
help me
Yeah, Visual Studio is also much more beginner-friendly than VSCode, especially with Unity. As long as you have the Unity workload, everything should work fine.
52 replies