Skip to content

Commit ccc8938

Browse files
committed
feat: create visualizer singleton
Signed-off-by: Dasun Abeykoon <[email protected]>
1 parent 996daa6 commit ccc8938

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2025 FRC 6423 - Ward Melville Iron Patriots
2+
// https://github.com/wmironpatriots
3+
//
4+
// Open Source Software; you can modify and/or share it under the terms of
5+
// MIT license file in the root directory of this project
6+
7+
package org.frc6423.robot.subsystems.superstructure;
8+
9+
/** Superstructure mech2d visualizer use `Visualizer.getDefault()` to get singleton instance */
10+
public class Visualizer {
11+
private Visualizer instance;
12+
13+
/**
14+
* @return {@link Visualizer} singleton instance
15+
*/
16+
public Visualizer getDefault() {
17+
if (instance == null) {
18+
instance = new Visualizer();
19+
}
20+
21+
return instance;
22+
}
23+
}

0 commit comments

Comments
 (0)