2018-09-04 16:51:39 +02:00
|
|
|
import freesewing from "freesewing";
|
|
|
|
import pluginBundle from "@freesewing/plugin-bundle";
|
|
|
|
import config from "../config/config";
|
|
|
|
import { version } from "../package.json";
|
2018-12-19 12:14:48 +01:00
|
|
|
// Parts
|
|
|
|
import draftBack from "./back";
|
|
|
|
import draftSide from "./side";
|
|
|
|
import draftFront from "./front";
|
|
|
|
import draftInset from "./inset";
|
|
|
|
|
|
|
|
// Constructor boilerplate
|
|
|
|
const Bruce = function(settings = false) {
|
|
|
|
freesewing.Pattern.call(this, { version: version, ...config });
|
|
|
|
this.with(pluginBundle);
|
|
|
|
if (settings !== false) this.mergeSettings(settings);
|
|
|
|
|
|
|
|
return this;
|
2018-09-04 16:51:39 +02:00
|
|
|
};
|
|
|
|
|
2018-12-19 12:14:48 +01:00
|
|
|
// Inheritance boilerplate
|
|
|
|
Bruce.prototype = Object.create(freesewing.Pattern.prototype);
|
|
|
|
Bruce.prototype.constructor = Bruce;
|
2018-09-04 16:51:39 +02:00
|
|
|
|
|
|
|
|
2018-12-19 12:14:48 +01:00
|
|
|
// Attach per-part draft methods to prototype
|
|
|
|
Bruce.prototype.draftBack = part => draftBack(part);
|
|
|
|
Bruce.prototype.draftSide = part => draftSide(part);
|
|
|
|
Bruce.prototype.draftInset = part => draftInset(part);
|
|
|
|
Bruce.prototype.draftFront = part => draftFront(part);
|
2018-09-04 16:51:39 +02:00
|
|
|
|
2018-12-19 12:14:48 +01:00
|
|
|
export default Bruce;
|