enum question
-
I'm sure I saw there was a documentation regarding to enum usage. I'm creating a game children that would involve a person that have enums of face, body, legs, feet, arms, hands. Each of those parts have unique values (i.e. face would have values of "round", "square", "oval"). I'm not quite sure on how to put those enums into "person" object. Can anyone point out the documentation? Thanks! (or should I use struct? or the other way?)
-
I'm sure I saw there was a documentation regarding to enum usage. I'm creating a game children that would involve a person that have enums of face, body, legs, feet, arms, hands. Each of those parts have unique values (i.e. face would have values of "round", "square", "oval"). I'm not quite sure on how to put those enums into "person" object. Can anyone point out the documentation? Thanks! (or should I use struct? or the other way?)
Something along the lines of:
public enum FaceType { Round , ... }
public enum FootType { Hairy , ... }public class Person
{
public FaceType Face { get ; private set ; }
public FootType LeftFoot { get ; private set ; }
public FootType RightFoot { get ; private set ; }...
}might work, but I'm unsure it would be best -- for one thing adding new attributes, like new face types, might be more difficult than necessary. You might consider have a config file or a database to store the types and values.
-
Something along the lines of:
public enum FaceType { Round , ... }
public enum FootType { Hairy , ... }public class Person
{
public FaceType Face { get ; private set ; }
public FootType LeftFoot { get ; private set ; }
public FootType RightFoot { get ; private set ; }...
}might work, but I'm unsure it would be best -- for one thing adding new attributes, like new face types, might be more difficult than necessary. You might consider have a config file or a database to store the types and values.