Answer the question
In order to leave comments, you need to log in
How to make an enum or something similar with a struct?
Like I want to have an enum and each element of the enum had its own structure?
Tipo:
public enum Rarity : Color
{
Rare = new Color(255,255,255),
}
и потом
Color color = Rarity.Rare
Answer the question
In order to leave comments, you need to log in
No way. In the future, perhaps there will be Discriminated Union, as in F#.
Now this can be solved through static
For example, something like this:
public static class Rarity {
public static Color Rare {get;} = new Color(255,255,255)
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question