Я написал этот код на Java. У меня есть эти два Enums, и я хотел знать, возможно ли написать enum, эквивалентный UnitType в C #, так как он продолжает давать мне ошибки.
public enum GenericUnitType {
BASIC,
NORMAL,
HERO;
}
public enum UnitType {
CLOSE_BASIC(GenericUnitType.BASIC),
DISTANCE_BASIC(GenericUnitType.BASIC),
CLOSE_NORMAL(GenericUnitType.NORMAL),
DISTANCE_NORMAL(GenericUnitType.NORMAL),
HERO_CLOSE_FIGHTER(GenericUnitType.HERO),
HERO_DISTANCE_FIGHTER(GenericUnitType.HERO);
private GenericUnitType genericType;
UnitType(final GenericUnitType genericType) {
this.genericType = genericType;
}
public GenericUnitType getGenericUnitType() {
return this.genericType;
}
}