Skip to content

Commit

Permalink
Add API for syncing properties in the property storage
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Harrington committed May 17, 2024
1 parent c8d4b21 commit 6c913c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/eu/mihosoft/vrl/v3d/CSG.java
Original file line number Diff line number Diff line change
Expand Up @@ -2764,4 +2764,9 @@ public Transform getCenterOfMass() {
return (Transform) o.get();
return new Transform().move(getCenter());
}

public CSG syncProperties(CSG dying) {
getStorage().syncProperties(dying.getStorage());
return this;
}
}
10 changes: 10 additions & 0 deletions src/main/java/eu/mihosoft/vrl/v3d/PropertyStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

import javafx.scene.paint.Color;

// TODO: Auto-generated Javadoc
Expand Down Expand Up @@ -123,4 +125,12 @@ static void randomColor(PropertyStorage storage) {
+ " " + c.getGreen()
+ " " + c.getBlue());
}
public Set<String> getKeys(){
return map.keySet();
}
public void syncProperties(PropertyStorage dying) {
for(String o:dying.map.keySet()) {
set(o,dying.map.get(o));
}
}
}

0 comments on commit 6c913c9

Please sign in to comment.