The Builder of Dimensional Arrays
Step-by-step construction of complex multi-dimensional spells.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Builder
ARCANUM SCHOOL: Conjuration // Arraymancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// MATLAB PATTERN //
classdef SpellMatrixBuilder < handle
properties (Access = private)
dimensions
energyType
coreArray
end
methods
function obj = SpellMatrixBuilder()
obj.reset();
end
function reset(obj)
obj.dimensions = [1 1];
obj.energyType = 'Void';
obj.coreArray = [];
end
function setDimensions(obj, dims)
obj.dimensions = dims;
end
function weaveEnergy(obj, energy)
obj.energyType = energy;
end
function spell = getResult(obj)
obj.coreArray = zeros(obj.dimensions) + magic(max(obj.dimensions));
spell = struct('Array', obj.coreArray, 'Energy', obj.energyType);
obj.reset();
end
end
end
Builder
When the arcane arrays grow too large to construct in a single breath…
Runic Tags:
#builder
#spells
#dimensions