Beispiel #1
0
        /// <summary>
        /// Constructor for filled
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="abilitySD"></param>
        /// <param name="parentList"></param>
        /// <param name="staticData"></param>
        public ComponentAbilityTemplateVM(ComponentTemplateParentVM parent, ComponentTemplateAbilitySD abilitySD, ObservableCollection <ComponentAbilityTemplateVM> parentList, StaticDataStore staticData) : this(parent, parentList, staticData)
        {
            Name        = abilitySD.Name;
            Description = abilitySD.Description;
            SelectedGuiHint.SelectedIndex = (int)abilitySD.GuiHint;
            if (abilitySD.AbilityDataBlobType != null)
            {
                AbilityDataBlobType = abilitySD.AbilityDataBlobType;
            }
            AbilityFormula = abilitySD.AbilityFormula;
            MinFormula     = abilitySD.MinFormula;
            MaxFormula     = abilitySD.MaxFormula;
            StepFormula    = abilitySD.StepFormula;
            //GuidDictionary = abilitySD.GuidDictionary;
            DictionaryVM <Guid, string> techSelected = new DictionaryVM <Guid, string>();

            if (abilitySD.GuiHint == GuiHint.GuiTechSelectionList)
            {
                foreach (var item in abilitySD.GuidDictionary)
                {
                    techSelected.Add(Guid.Parse(item.Key.ToString()), _staticData.Techs[Guid.Parse(item.Key.ToString())].Name);
                }
                GuidDict = new TechListVM(techSelected, _staticData);
            }
        }
Beispiel #2
0
 public ItemDictVM(ComponentTemplateParentVM parent, Type enumtype) : base(parent)
 {
     foreach (var item in Enum.GetValues(enumtype))
     {
         Items.Add((T1)item, item.ToString());
     }
 }
 public MineralFormulaVM(ComponentTemplateParentVM parent, StaticDataStore staticDataStore) : base(parent)
 {
     _dataStore = staticDataStore;
     Minerals   = new DictionaryVM <Guid, string>(DisplayMode.Value);
     foreach (var item in staticDataStore.Minerals.Values)
     {
         Minerals.Add(item.ID, item.Name);
     }
 }
 /// <summary>
 /// Constructor for empty VM
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="gameVM"></param>
 public ComponentTemplateMainPropertiesVM(ComponentTemplateParentVM parent, GameVM gameVM) : base(parent)
 {
     _staticData       = gameVM.Game.StaticData;
     SubControlInFocus = FocusedControl.MassControl;
     foreach (var item in Enum.GetValues(typeof(ComponentMountType)))
     {
         if ((ComponentMountType)item != ComponentMountType.None)
         {
             MountType.Add((ComponentMountType)item, false);
         }
     }
 }
Beispiel #5
0
        /// <summary>
        /// Constructor for empty
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="parentList"></param>
        /// <param name="staticData"></param>
        public ComponentAbilityTemplateVM(ComponentTemplateParentVM parent, ObservableCollection <ComponentAbilityTemplateVM> parentList, StaticDataStore staticData) : base(parent)
        {
            _staticData = staticData;

            //SelectedGuiHint = new DictionaryVM<GuiHint, string>(DisplayMode.Value);
            ParentList = parentList;
            foreach (var item in Enum.GetValues(typeof(GuiHint)))
            {
                SelectedGuiHint.Add((GuiHint)item, Enum.GetName(typeof(GuiHint), item));
            }
            SelectedGuiHint.SelectionChangedEvent += SelectedGuiHint_SelectionChangedEvent;
            SelectedGuiHint.SelectedIndex          = 0;
            _abilityDataBlobTypeSelection          = AbilityTypes();

            foreach (var item in EnumTypes())
            {
                ItemDictTypes.Add(item, item.Name);
            }
            ItemDictTypes.SelectionChangedEvent += ItemDictTypes_SelectionChangedEvent;
            ItemDictTypes.SelectedIndex          = 0;
        }
Beispiel #6
0
        public FormulaEditorVM(ComponentTemplateParentVM parent, StaticDataStore staticData)
        {
            _parent = parent;

            TechList = new DictionaryVM <Guid, string>();
            foreach (var item in staticData.Techs.Values)
            {
                TechList.Add(item.ID, item.Name);
            }
            TechList.SelectionChangedEvent += TechList_SelectionChangedEvent;

            ParameterButtons = new List <ButtonInfo>();
            ParameterButtons.Add(new ButtonInfo("[Size]", "Links to the Size formula field", this));
            ParameterButtons.Add(new ButtonInfo("[Crew]", "Links to the Crew requred formula field", this));
            ParameterButtons.Add(new ButtonInfo("[HTK]", "Links to the Hit To Kill formula field", this));
            ParameterButtons.Add(new ButtonInfo("[ResearchCost]", "Links to the Research cost formula field", this));
            ParameterButtons.Add(new ButtonInfo("[MineralCost]", "Links to the Mineral cost formula field", this));
            ParameterButtons.Add(new ButtonInfo("[CreditCost]", "Links to the Credit Cost formula field", this));
            ParameterButtons.Add(new ButtonInfo("[GuidDict]", "A special parameter for a key value pair collection, used in ability formula fields", this));

            FunctionButtons = new List <ButtonInfo>();
        }
 public MineralFormulaVM(ComponentTemplateParentVM parent, StaticDataStore staticDataStore, KeyValuePair <Guid, string> guidFormulaKVP) : this(parent, staticDataStore)
 {
     MineralFormula         = guidFormulaKVP.Value;
     Minerals.SelectedIndex = Minerals.GetIndex(new KeyValuePair <Guid, string>(guidFormulaKVP.Key, Minerals[guidFormulaKVP.Key]));
 }
 public ComponentTemplateDesignerBaseVM(ComponentTemplateParentVM parent)
 {
     ParentVM = parent;
 }
 /// <summary>
 /// Constructor for VM filled with componentSD
 /// </summary>
 /// <param name="parent"></param>
 /// <param name="gameData"></param>
 /// <param name="designSD"></param>
 public ComponentTemplateMainPropertiesVM(ComponentTemplateParentVM parent, GameVM gameData, ComponentTemplateSD designSD) : this(parent, gameData)
 {
     SetDesignSD(designSD);
 }