コード例 #1
0
        public void SetDesignSD(ComponentTemplateSD designSD)
        {
            Name        = designSD.Name;
            Description = designSD.Description;
            _ID         = designSD.ID;

            MassFormula    = designSD.MassFormula;
            VolumeFormula  = designSD.VolumeFormula;
            HTKFormula     = designSD.HTKFormula;
            CrewReqFormula = designSD.CrewReqFormula;
            MineralCostFormula.Clear();
            foreach (var item in designSD.ResourceCostFormula)
            {
                MineralCostFormula.Add(new MineralFormulaVM(ParentVM, _staticData, item));
            }
            MineralCostFormula.Add(new MineralFormulaVM(ParentVM, _staticData));

            ResearchCostFormula   = designSD.ResearchCostFormula;
            CreditCostFormula     = designSD.CreditCostFormula;
            BuildPointCostFormula = designSD.BuildPointCostFormula;

            foreach (object value in Enum.GetValues(typeof(ComponentMountType)))
            {
                var currentValue = (ComponentMountType)value;
                if ((currentValue & designSD.MountType) != 0)
                {
                    MountType[currentValue] = true;
                }
            }
        }
コード例 #2
0
        public void ClearSelection()
        {
            Name           = "";
            Description    = "";
            _ID            = Guid.NewGuid();
            MassFormula    = "";
            VolumeFormula  = "";
            HTKFormula     = "";
            CrewReqFormula = "";
            MineralCostFormula.Clear();
            MineralCostFormula.Add(new MineralFormulaVM(ParentVM, _staticData));
            MineralCostFormula.Last().PropertyChanged += ComponentTemplateVM_PropertyChanged;
            ResearchCostFormula   = "";
            CreditCostFormula     = "";
            BuildPointCostFormula = "";
            //MountType.Clear();// = new ObservableDictionary<ComponentMountType, bool?>();


            foreach (var item in MountType.ToArray())
            {
                MountType[item.Key] = false;
            }
        }