Adds the getComponents function.
@@ -7,6 +7,7 @@ import com.valkryst.VTerminal.palette.ColorPalette;
import lombok.ToString;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.EventListener;
import java.util.List;
import java.util.concurrent.locks.ReentrantReadWriteLock;
@@ -119,4 +120,14 @@ public class Layer extends Component {
componentsLock.writeLock().unlock();
}
+
+ /**
+ * Retrieves an unmodifiable list of the layer's components.
+ *
+ * @return
+ * An unmodifiable list of the layer's components.
+ */
+ public List<Component> getComponents() {
+ return Collections.unmodifiableList(components);
+ }
}
