public ChangeIdTool(HasId elementWithTargetId, string newId, bool updateTree, bool reloadPanel) { this.elementWithTargetId = elementWithTargetId; this.id = newId; this.oldId = elementWithTargetId.getId(); this.updateTree = updateTree; this.reloadPanel = reloadPanel; this.controller = Controller.getInstance(); }
public override bool doTool() { bool done = false; if (!elementWithTargetId.getId().Equals(id)) { elementWithTargetId.setId(id); done = true; if (updateTree) { controller.updateStructure(); } if (reloadPanel) { controller.updatePanel(); } } return(done); }
public static bool IsRemoved(this HasId element) { return(Game.Instance.GameState.GetRemovedElements().Contains(element.getId())); }