#include "NoiseNode.h" #include "NoiseFunctionSimplex.h" #include "Logs.h" NoiseNode::NoiseNode(DefinitionNode *parent, const string &name) : DefinitionNode(parent, name) { noise = new NoiseFunctionSimplex(); } NoiseNode::~NoiseNode() { delete noise; } void NoiseNode::save(PackStream *stream) const { noise->save(stream); } void NoiseNode::load(PackStream *stream) { noise->load(stream); } void NoiseNode::copy(DefinitionNode *destination) const { if (destination->getTypeName() == getTypeName()) { auto tdestination = static_cast(destination); if (tdestination) { noise->copy(tdestination->noise); } } else { Logs::error("Definition") << "Can't copy from " << getTypeName() << " to " << destination->getTypeName() << endl; } } string NoiseNode::toString(int indent) const { return DefinitionNode::toString(indent) + " - scaling: " + to_string(noise->getScaling()) + " step " + to_string(noise->getStepScaling()) + " - height: " + to_string(noise->getHeight()) + " step " + to_string(noise->getStepScaling()); }