/** * Creates a new YoEnum with the same parameters as this one, and registers it to the passed {@link YoVariableRegistry}. * * @param newRegistry YoVariableRegistry to duplicate this YoEnum to * @return the newly created and registered YoEnum */ @Override public YoEnum<T> duplicate(YoVariableRegistry newRegistry) { YoEnum<T> retVar = new YoEnum<>(getName(), getDescription(), newRegistry, getEnumType(), getAllowNullValue()); retVar.set(getEnumValue()); return retVar; }
if (((YoEnum<?>) variable).isBackedByEnum()) yoVariableDefinition.setEnumType(getOrAddEnumType(((YoEnum<?>) variable).getEnumType().getCanonicalName(), ((YoEnum<?>) variable).getEnumValuesAsString()));