MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / copyTo

Method copyTo

src/main/java/field/graphics/FLine.java:753–768  ·  view source on GitHub ↗

copies a node from (potentially some other) line to here. Also copies attributes

(Node node)

Source from the content-addressed store, hash-verified

751 } else if (node instanceof LineTo) {
752 this.lineTo(node.to);
753 this.last().attributes.putAll(node.attributes.duplicate());
754 return this;
755 } else if (node instanceof CubicTo) {
756 this.cubicTo(((CubicTo) node).c1, ((CubicTo) node).c2, ((CubicTo) node).to);
757 this.last().attributes.putAll(node.attributes.duplicate());
758 return this;
759 }
760 throw new Error();
761 }
762
763 /**
764 * copies a node from (potentially some other) line to here. Also copies attributes. Cubic segments are reversed.
765 */
766 public FLine copyToFlipped(Node node, Vec3 dest) {
767 if (node instanceof MoveTo) {
768 this.moveTo(dest);
769 this.last().attributes.putAll(node.attributes.duplicate());
770 return this;
771 } else if (node instanceof LineTo) {

Callers 5

segmentMethod · 0.95
splitMethod · 0.95
appendMethod · 0.95
railMethod · 0.45
extrudeMethod · 0.45

Calls 6

moveToMethod · 0.95
lastMethod · 0.95
lineToMethod · 0.95
cubicToMethod · 0.95
putAllMethod · 0.80
duplicateMethod · 0.65

Tested by

no test coverage detected