1234567891011121314151617181920212223242526272829303132333435 |
- #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;
- }
|