Exemple #1
0
 public NodeController()
 {
     idHandler    = IdHandler.GetInstance();
     nodeRelation = new NodeRelation();
     context      = new NodeContext(idHandler, nodeRelation.OnMakeRelation, nodeRelation.OnClickOnClass, nodeRelation.OnDeleteField, OnDeleteClass);
     LoadData();
 }
Exemple #2
0
 public Actor(string actorName, IdHandler idhadler, System.Action <int> OnMakeRelation)
 {
     this.actorName      = actorName;
     ID                  = idhadler.GetActorID();
     transform           = new Rect(20, 20, 100, 120);
     img                 = ResourcesConfig.GetInstance().actor;
     this.OnMakeRelation = OnMakeRelation;
 }
Exemple #3
0
        public void Save()
        {
            var json = JsonUtility.ToJson(this);

            SaveUtility.SaveInProject(json, NodeConsts.FullResourcesFolder + "/" + NodeConsts.USECASE_DATA_FILE);
            IdHandler.GetInstance().OnSaveFile();
            AssetDatabase.Refresh();
        }
Exemple #4
0
 public NodeContext(IdHandler idHandler, System.Action <int, ulong> OnMakeRelation, System.Action <int> OnMakeRelationToClass,
                    System.Action <int, ulong> OnDeleteField, System.Action <int> OnDeleteClass)
 {
     this.idHandler             = idHandler;
     this.OnMakeRelation        = OnMakeRelation;
     this.OnMakeRelationToClass = OnMakeRelationToClass;
     this.OnDeleteField         = OnDeleteField;
     this.OnDeleteClass         = OnDeleteClass;
 }
Exemple #5
0
        private static void Load()
        {
            string json = string.Empty;
            var    o    = EditorGUIUtility.Load(NodeConsts.ResourcesFolder + "/" + NodeConsts.ID_HANDLER);

            if (o != null)
            {
                instance = new IdHandler();
                json     = ((TextAsset)o).text;
                JsonUtility.FromJsonOverwrite(json, instance);
            }
            else
            {
                instance = new IdHandler();
            }
        }
Exemple #6
0
        private void LoadData()
        {
            string json = string.Empty;
            var    o    = EditorGUIUtility.Load(NodeConsts.ResourcesFolder + "/" + NodeConsts.SEQUENCE_DATA_FILE);

            if (o != null)
            {
                json = ((TextAsset)o).text;
                JsonUtility.FromJsonOverwrite(json, this);
            }
            else
            {
                UseCase c = new UseCase(IdHandler.GetInstance(), useCaseRelation.OnSelectUseCase);
                listOfUseCase.Add(c);
                Actor a = new Actor("Actor name", IdHandler.GetInstance(), useCaseRelation.OnMakeStartRelation);
                actors.Add(a);
            }
        }
Exemple #7
0
 public UseCase(IdHandler idHander, System.Action <int> OnFinishRelation)
 {
     ID                    = idHander.GetUseCaseID();
     transform             = new Rect(20, 20, 100, 120);
     this.OnFinishRelation = OnFinishRelation;
 }