Esempio n. 1
0
    static public void DeleteDiagram(ERData node)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("DeleteDiagram", newAction));
    }
Esempio n. 2
0
 public static void NextRoom(string sceneName, string diagramCode)
 {
     PlayerEventHandler.RoomMovement(SceneManager.GetActiveScene().name, sceneName);
     DiagramKeeper.SetDiagramCode(diagramCode);
     DiagramKeeper.GetCurrDiagram();
     SceneManager.LoadScene(sceneName);
     SceneManager.LoadScene("PlayerUI", LoadSceneMode.Additive);
     inUIscene = false;
 }
Esempio n. 3
0
    static public void ChangeCardinality(LinkData link)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Name", link.name);
        newAction.Add("New Cardinality", link.nodeState);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeCardinality", newAction));
    }
Esempio n. 4
0
    static public void AddNode(NodeData node)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Name", node.nodeName);
        newAction.Add("Type", node.type.ToString());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("AddNode", newAction));
    }
Esempio n. 5
0
    static public void RemLink(LinkData link)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Node1-Id", link.linkedNodeId[0].ToString());
        newAction.Add("Node2-Id", link.linkedNodeId[1].ToString());
        newAction.Add("Type", link.type.ToString());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("RemoveLink", newAction));
    }
Esempio n. 6
0
    static public void ChangeGenType(NodeData node, string oldState)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Id", node.id.ToString());
        newAction.Add("From", oldState);
        newAction.Add("To", node.nodeName);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeGenType", newAction));
    }
Esempio n. 7
0
    static public void ChangeParticipation(LinkData link)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Name", link.name);
        string participation = link.participationIsTotal ? "Total" : "Parcial";

        newAction.Add("New Participation", link.nodeState);
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeParticipation", newAction));
    }
Esempio n. 8
0
    static public void ChangeGenLinkType(LinkData link, string oldType)
    {
        ActionData newAction = new ActionData();

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Node1-Id", link.linkedNodeId[0].ToString());
        newAction.Add("Node2-Id", link.linkedNodeId[1].ToString());
        newAction.Add("From", oldType);
        newAction.Add("To", link.type.ToString());
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeGenLinkType", newAction));
    }
Esempio n. 9
0
    static public void ChangeKeyAttribute(NodeData node, string oldState)
    {
        ActionData newAction = new ActionData();
        string     keyValue  = "";

        newAction.Add("DiagramCode", DiagramKeeper.GetCurrDiagramCode());
        newAction.Add("Name", node.nodeName);
        newAction.Add("Id", node.id.ToString());
        newAction.Add("Type", node.type.ToString());
        keyValue = node.isKey ? "Es" : "No es";
        newAction.Add("Estado", keyValue + " atributo clave");
        instance.dataLog.actions.Add(new Tuple <string, ActionData>("ChangeKeyAttribute", newAction));
    }
Esempio n. 10
0
    void Start()
    {
        Cursor.lockState = CursorLockMode.None;
        //Get Canvas Scaler component
        canvas_ = GetComponent <Canvas>();
        //Get Graphic and Data components of the ERDiagram
        erData_    = DiagramKeeper.GetCurrDiagram();
        erDiagram_ = GetComponent <ERDiagram>();
        //Setup path display
        pathDisplay.text = GetPathToDiagram();
        //Load all names on the nameDropdown Menu
        List <string> dropdownOptions = GlobalController.config.nodeNames;

        //Apply the names to the DropDown Component
        nameList     = nameMenu.GetComponent <Dropdown>();
        nameListAttr = nameMenuAtr.GetComponent <Dropdown>();
        nameList.AddOptions(dropdownOptions);
        nameListAttr.AddOptions(dropdownOptions);
        //Create diagram form diagramData
        erDiagram_.DrawDiagram(erData_);
    }
Esempio n. 11
0
 public string GetPathToDiagram()
 {
     return("Se guarda en: " + Path.Combine(Application.persistentDataPath, "Saves") + " Codigo: " + DiagramKeeper.GetCurrDiagramCode());
 }
Esempio n. 12
0
 // Start is called before the first frame update
 void Start()
 {
     GetComponent <Text>().text = "Se guarda en: " + Application.persistentDataPath + " Codigo: " + DiagramKeeper.GetCurrDiagramCode();
 }