123456789101112131415161718192021222324252627282930313233343536373839 |
- #include "GeneratorTemplate.h"
- GeneratorTemplate::GeneratorTemplate(float propability,
- Framework::Vec3<int> minPosOffset,
- Framework::Vec3<int> maxSize)
- : ReferenceCounter(),
- propability(propability),
- minPosOffset(minPosOffset),
- maxSize(maxSize)
- {}
- bool GeneratorTemplate::canEffect(
- Framework::Vec3<int> location, Framework::Vec3<int> affectedLocation) const
- {
- Framework::Vec3<int> localPos
- = affectedLocation - (location + minPosOffset);
- return localPos.x >= 0 && localPos.y >= 0 && localPos.z >= 0
- && localPos.x < maxSize.x && localPos.y < maxSize.y
- && localPos.z < maxSize.z;
- }
- float GeneratorTemplate::getPropability() const
- {
- return propability;
- }
- Framework::Vec3<int> GeneratorTemplate::getMinAffectedOffset() const
- {
- return minPosOffset;
- }
- Framework::Vec3<int> GeneratorTemplate::getMaxAffectedOffset() const
- {
- return minPosOffset + maxSize;
- }
- GeneratorTemplateFactory::GeneratorTemplateFactory()
- : ReferenceCounter()
- {}
|