diff --git a/.idea/.gitignore b/.idea/.gitignore index 13566b81b018ad684f3a35fee301741b2734c8f4..a9d7db9c0a81b2db47ca92e4e180b30090b27632 100644 --- a/.idea/.gitignore +++ b/.idea/.gitignore @@ -6,3 +6,5 @@ # Datasource local storage ignored files /dataSources/ /dataSources.local.xml +# GitHub Copilot persisted chat sessions +/copilot/chatSessions diff --git a/src/main/java/edu/ntnu/idatt2003/ChaosGameDescription.java b/src/main/java/edu/ntnu/idatt2003/ChaosGameDescription.java new file mode 100644 index 0000000000000000000000000000000000000000..517953a0e7a434a2fc60ce516453d481bec921a2 --- /dev/null +++ b/src/main/java/edu/ntnu/idatt2003/ChaosGameDescription.java @@ -0,0 +1,52 @@ +package edu.ntnu.idatt2003; + +import java.util.List; + +/** + * Represents a description of a chaos game. + */ +public class ChaosGameDescription { + private final List<Transform2D> transforms; + private final Vector2D minCoords; + private final Vector2D maxCoords; + + + /** + * Creates a new ChaosGameDescription with the given transformations. + * The transformations are used to create the fractal. + * + * @param transforms A list of the transformation objects to be used in the chaos game. + * @param minCoords Lower left corner coordinates. + * @param maxCoords Upper right corner coordinates. + */ + public ChaosGameDescription(List<Transform2D> transforms, Vector2D minCoords, Vector2D maxCoords) { + this.transforms = transforms; + this.minCoords = minCoords; + this.maxCoords = maxCoords; + } + + + /** + * Returns the list of transformations. + * @return the list of Transform2D objects. + */ + public List<Transform2D> getTransforms() { + return transforms; + } + + /** + * Returns the minimum coordinates. + * @return minCoords which is the lower left corner Vector2D of the fractal's bounding rectangle. + */ + public Vector2D getMinCoords() { + return minCoords; + } + + /** + * Returns the maximum coordinates. + * @return maxCoords which is the upper right corner Vector2D of the fractal's bounding rectangle. + */ + public Vector2D getMaxCoords() { + return maxCoords; + } +}