fantasy/painting/factory.js
2018-11-18 21:04:50 +03:00

15 lines
307 B
JavaScript

import Rectangle from "./rectangle.js";
const options = [
Rectangle
]
export default {
createRandomShape: function() {
let Shape = options[Math.floor(Math.random() * options.length)];
let opts = Shape.randomOptions();
let shape = Shape.fromOptions(opts);
}
};