triplemocha
triplemocha
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
Ah, I see.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
unmanaged is new to me.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
Seems to be working. Thanks!
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
It's a custom Random class I made, so last value is max - 1.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
Same thing.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
I did.
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
30 replies
CC#
Created by triplemocha on 7/16/2023 in #help
❔ How to get a random enum value?
Appears to be working:
public static T NextValue<T>() where T : Enum
{
return (T)(object)Rand.Next(0, Enum.GetValues(typeof(T)).Length - 1);
}
public static T NextValue<T>() where T : Enum
{
return (T)(object)Rand.Next(0, Enum.GetValues(typeof(T)).Length - 1);
}
30 replies
CC#
Created by triplemocha on 7/7/2023 in #help
❔ Should procedural 2d maps be with structs or instantiated with 'new'?
Okay. To add, my intentions is to generate these in Unity and hope using classes won't cause a performance issue.
6 replies
CC#
Created by triplemocha on 6/29/2023 in #help
❔ Any issue with this for a game?
I see.
14 replies
CC#
Created by triplemocha on 6/29/2023 in #help
❔ Any issue with this for a game?
I did hear from MS that structs should be less than 16kb in C#. That confused me. It didn't matter in C++.
14 replies
CC#
Created by triplemocha on 6/29/2023 in #help
❔ Any issue with this for a game?
I think it should be an easy fix though if I had to switch. I used classes in C++ and did this whole thing and moved it to C#. So, I’m used to cached/bit wise copies.
14 replies
CC#
Created by triplemocha on 6/29/2023 in #help
❔ Any issue with this for a game?
I see. I wanted Cell to be a struct before, but someone recommended a class. Little easier to work with then writing ref frequently.
14 replies
CC#
Created by triplemocha on 6/29/2023 in #help
❔ Any issue with this for a game?
What structure would be that?
14 replies