//合并
 public void combine(VarsManager srcManager)
 {
     for (int i = 0; i < srcManager.getElementCount(); i++)
     {
         VarElement elementDest = (VarElement)srcManager.getElement(i);
         //寻找重复
         bool  findSame = false;
         VarElement elementLocal = null;
         for (int j = 0; j < getElementCount(); j++)
         {
             elementLocal = (VarElement)getElement(j);
             if (elementDest.equalsNameAndType(elementLocal))
             {
                 findSame = true;
                 break;
             }
         }
         if (this.Equals(form_main.iDsManager))
         {
             Console.WriteLine("准备合并ID常量:" + elementDest.name);
         }
         //处理
         if (!findSame)
         {
             elementDest.combineTo(this);//将对象并入本列表
             Console.WriteLine("合并加入:" + elementDest.name);
         }
         else
         {
             Console.WriteLine("合并更新:" + elementDest.name);
             elementLocal.setValue(elementDest.getValue());//用新值替换当前值,如果“相等”不包括“值”判断时有效
             elementDest.changeUseInfor(elementLocal);//引用转移
         }
     }
 }
 public static VarElement createElement(VarsManager managerT)
 {
     manager = managerT;
     element = new VarElement(manager,Consts.PARAM_STR);
     SmallDialog_NewVar_String dialog = new SmallDialog_NewVar_String("新建字符变量");
     dialog.ShowDialog();
     return element;
 }
 public static VarElement createElement(VarsManager managerT)
 {
     manager = managerT;
     element = new VarElement(manager, Consts.PARAM_INT);
     SmallDialog_NewVar_INT dialog = new SmallDialog_NewVar_INT("新建整型变量");
     dialog.ShowDialog();
     return element;
 }
 //设置地图单元
 public static void configElement(VarElement elementT)
 {
     if (elementT == null)
     {
         Console.WriteLine("error in configElement");
         return;
     }
     manager = (VarsManager)elementT.parent;
     element = elementT;
     SmallDialog_NewVar_String dialog = new SmallDialog_NewVar_String("设置字符变量");
     dialog.textBox_name.Text = element.name;
     dialog.textBox_Value.Text = (String)element.getValue();
     dialog.ShowDialog();
 }
 //设置地图单元
 public static void configElement(VarElement elementT)
 {
     if (elementT == null)
     {
         Console.WriteLine("error in configElement");
         return;
     }
     manager = (VarsManager)elementT.parent;
     element = elementT;
     SmallDialog_NewVar_INT dialog = new SmallDialog_NewVar_INT("设置整型变量");
     dialog.textBox_name.Text = element.name;
     dialog.numericUpDown_Value.Value = (int)element.getValue();
     dialog.ShowDialog();
 }
Ejemplo n.º 6
0
 public void releaseRes()
 {
     m_HistoryManager=null;
     textsManager = null;
     mapImagesManager = null;
     mapsManager = null;
     varIntManager = null;
     varStringManager = null;
     triggerFunctionManager = null;
     contextFunctionManager = null;
     executionFunctionManager = null;
     //triggersManager = null;
     propertyTypesManager = null;
 }
Ejemplo n.º 7
0
        //初始化参数===========================================================
        public void initData(String path)
        {
            path_file = path;
            path_folder = path_file.Substring(0, path_file.LastIndexOf('\\') + 1);

            m_HistoryManager = new UndoManager();
            m_HistoryManager.MaxUndoLevel = 100;
            textsManager = new TextsManager(this);

            mapImagesManager = new MImgsManager(this);
            mapsManager = new MapsManager(this, mapImagesManager);

            varIntManager = new VarsManager(this);
            varStringManager = new VarsManager(this);
            triggerFunctionManager = new FunctionsManager(this);
            contextFunctionManager = new FunctionsManager(this);
            executionFunctionManager = new FunctionsManager(this);
            iDsManager = new VarsManager(this);
            propertyTypesManager = new PropertyTypesManager(this);

            form_MAnimation = new Form_MAnimation(this);
            mapsManager.initAntetype(form_MAnimation.form_MActorList.actorsManager);
            if (Consts.PATH_PROJECT_FILEPATH != null)
            {
                this.Text = Consts.PATH_PROJECT_FILEPATH;
            }
            userDoc.initUserData(path);//读入数据
        }
 //合并入
 public void combineTo(VarsManager parentT)
 {
     parent = parentT;
     parent.addElement(this);
 }
 public bool isUsedInHeadFile = false;//被头文件使用
 public VarElement(VarsManager parentT, byte varTypeT)
     : base(parentT)
 {
     varType= varTypeT;
 }