While I was playing around with enums I created this:
enum class ElectricPart {
// Wow, what I had implemented here? Is it good or bad?!
;
enum class VisionLight(val id:String){
LIGHTS_OFF("lights_off"),
POSITION_LIGHTS("lights_position"),
DRIVING_LIGHTS("lights_driving"),
LONG_RANGE_LIGHTS("lights_long_range"),
LONG_RANGE_SIGNAL_LIGHTS("lights_long_range_signal")
}
enum class DirectionLight(val id:String){
DIRECTION_LIGHTS_RIGHT("lights_direction_right"),
DIRECTION_LIGHTS_LEFT("lights_direction_left"),
DIRECTION_LIGHTS_STRAIGHT("lights_direction_straight")
}
//More enum classes if needed
}
A car has electric parts (ElectricPart). The VisionLights and DirectionLights are part of the electrics of a car.
Is this a good implementation? Is this bad? For sure it feels weird!
I would like to hear your comments about this one!
;before a newenumclass?