paysages3d/src/definition/CloudsDefinition.cpp
Michaël Lemaire 2b65f1d26a Refactored layers system to work better as DefinitionNode
It now features undo/redo of layer creation and removal
2015-11-20 01:07:31 +01:00

20 lines
586 B
C++

#include "CloudsDefinition.h"
#include "CloudLayerDefinition.h"
static DefinitionNode *_layerConstructor(Layers *parent, const std::string &name) {
return new CloudLayerDefinition(parent, name);
}
CloudsDefinition::CloudsDefinition(DefinitionNode *parent) : Layers(parent, "clouds", _layerConstructor) {
}
void CloudsDefinition::applyPreset(CloudsPreset preset) {
clear();
if (preset == CLOUDS_PRESET_PARTLY_CLOUDY) {
CloudLayerDefinition layer(NULL, "Strato-cumulus");
layer.type = CloudLayerDefinition::STRATOCUMULUS;
addLayer(layer);
}
}