Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package engine.terrain;
- import java.util.ArrayList;
- import java.util.List;
- public class Node {
- private Node parent;
- private List<Node> children;
- public Node() {
- this.children = new ArrayList<Node>();
- }
- public void update() {
- for(Node child : children) {
- child.update();
- }
- }
- public void render() {
- for(Node child : children) {
- child.render();
- }
- }
- public void addChild(Node node) {
- children.add(node);
- node.setParent(this);
- }
- public Node getParent() {
- return parent;
- }
- public void setParent(Node parent) {
- this.parent = parent;
- }
- public List<Node> getChildren() {
- return children;
- }
- public void setChildren(List<Node> children) {
- this.children = children;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement