private static ItemSet createTestSet(string championKey = "Ashe") { ItemSet set = new ItemSet(); set.title = championKey + " ProBuilds"; set.description = "this is a test."; set.type = ItemSet.Type.Custom; set.map = ItemSet.Map.SummonersRift; set.mode = ItemSet.Mode.any; set.priority = false; set.sortrank = 0; set.blocks = new List<ItemSet.Block>(); ItemSet.Block block = new ItemSet.Block(); block.type = "Starting Out"; block.recMath = true; block.minSummonerLevel = -1; block.maxSummonerlevel = -1; block.showIfSummonerSpell = ""; block.hideIfSummonerSpell = ""; block.items = new List<ItemSet.Item>(); ItemSet.Item item = new ItemSet.Item(); item.id = "1001"; item.count = 2; item.percentage = 0.54f; block.items.Add(item); set.blocks.Add(block); return set; }
public DG_ItemSetName(Character character, ItemSet thenewItemSet) { InitializeComponent(); #if !SILVERLIGHT this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner; this.WindowState = System.Windows.WindowState.Normal; this.ResizeMode = System.Windows.ResizeMode.NoResize; #endif Character = character; newItemSet = thenewItemSet; }
public CovarianceMaternIso() : base() { Name = ItemName; Description = ItemDescription; Parameters.Add(new OptionalValueParameter<DoubleValue>("InverseLength", "The inverse length parameter of the isometric Matern covariance function.")); Parameters.Add(new OptionalValueParameter<DoubleValue>("Scale", "The scale parameter of the isometric Matern covariance function.")); var validDValues = new ItemSet<IntValue>(); validDValues.Add((IntValue)new IntValue(1).AsReadOnly()); validDValues.Add((IntValue)new IntValue(3).AsReadOnly()); validDValues.Add((IntValue)new IntValue(5).AsReadOnly()); Parameters.Add(new ConstrainedValueParameter<IntValue>("D", "The d parameter (allowed values: 1, 3, or 5) of the isometric Matern covariance function.", validDValues, validDValues.First())); }
public static ItemSet Go(this ItemSet itemset,char c) { ItemSet set=new ItemSet(); foreach (Item i in itemset) { if (i.Index < i.Production.Right.Length && i.Production.Right[i.Index] == c) { Item item = new Item(i.Production, i.Index + 1, i.Symbol); set.Add(item); } } return set; }
public CovariancePiecewisePolynomial() : base() { Name = ItemName; Description = ItemDescription; Parameters.Add(new OptionalValueParameter<DoubleValue>("Length", "The length parameter of the isometric piecewise polynomial covariance function.")); Parameters.Add(new OptionalValueParameter<DoubleValue>("Scale", "The scale parameter of the piecewise polynomial covariance function.")); var validValues = new ItemSet<IntValue>(new IntValue[] { (IntValue)(new IntValue().AsReadOnly()), (IntValue)(new IntValue(1).AsReadOnly()), (IntValue)(new IntValue(2).AsReadOnly()), (IntValue)(new IntValue(3).AsReadOnly()) }); Parameters.Add(new ConstrainedValueParameter<IntValue>("V", "The v parameter of the piecewise polynomial function (allowed values 0, 1, 2, 3).", validValues, validValues.First())); }
private void WriteItemSet(string block, ItemSet itemSet, Character character) { WriteLine(4, block + " = {"); WriteLine(8, "items = {"); if (itemSet == null) { for (int slotId = 1; slotId <= 19; slotId++) { WriteLine(12, "{ slot = " + slotId + ", item = \"" + nullItem + "\" },"); } } else { WriteItem(12, itemSet[CharacterSlot.Head], character, CharacterSlot.Head); WriteItem(12, itemSet[CharacterSlot.Neck], character, CharacterSlot.Neck); WriteItem(12, itemSet[CharacterSlot.Shoulders], character, CharacterSlot.Shoulders); WriteItem(12, itemSet[CharacterSlot.Shirt], character, CharacterSlot.Shirt); WriteItem(12, itemSet[CharacterSlot.Chest], character, CharacterSlot.Chest); WriteItem(12, itemSet[CharacterSlot.Waist], character, CharacterSlot.Waist); WriteItem(12, itemSet[CharacterSlot.Legs], character, CharacterSlot.Legs); WriteItem(12, itemSet[CharacterSlot.Feet], character, CharacterSlot.Feet); WriteItem(12, itemSet[CharacterSlot.Wrist], character, CharacterSlot.Wrist); WriteItem(12, itemSet[CharacterSlot.Hands], character, CharacterSlot.Hands); WriteItem(12, itemSet[CharacterSlot.Finger1], character, CharacterSlot.Finger1); WriteItem(12, itemSet[CharacterSlot.Finger2], character, CharacterSlot.Finger2); WriteItem(12, itemSet[CharacterSlot.Trinket1], character, CharacterSlot.Trinket1); WriteItem(12, itemSet[CharacterSlot.Trinket2], character, CharacterSlot.Trinket2); WriteItem(12, itemSet[CharacterSlot.Back], character, CharacterSlot.Back); WriteItem(12, itemSet[CharacterSlot.MainHand], character, CharacterSlot.MainHand); WriteItem(12, itemSet[CharacterSlot.OffHand], character, CharacterSlot.OffHand); WriteItem(12, itemSet[CharacterSlot.Ranged], character, CharacterSlot.Ranged); WriteItem(12, itemSet[CharacterSlot.Tabard], character, CharacterSlot.Tabard); } WriteLine(8, "},"); WriteLine(4, "},"); }
/// <summary> /// Adds an ItemSet to the ItemSetList for this Character. /// ItemSets are for the Comparison chart. /// It will automatically check to see if the ItemSet is already in the list. /// </summary> /// <param name="newset"></param> public void AddToItemSetList(ItemSet newset) { if (itemSetList == null) return; bool didsomething = false; if (!ItemSetListContainsItemSetByName(newset.Name)) { itemSetList.Add(newset); didsomething |= true; } else { // Remove the original and replace it RemoveFromItemSetList(newset); itemSetList.Add(newset); didsomething |= true; } if (didsomething) { OnCalculationsInvalidated(); } }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcSectionReinforcementProperties(IModel model, int label, bool activated) : base(model, label, activated) { _crossSectionReinforcementDefinitions = new ItemSet <IfcReinforcementBarProperties>(this, 0, 6); }
private void results_Closed(object sender, EventArgs e) { OptimizerResults results = sender as OptimizerResults; if (results.DialogResult.GetValueOrDefault()) { if (results.WeWantToStoreIt) { ItemSet newItemSet = new ItemSet() { Name = string.Format("Optimized GearSet {0}", character.GetNumItemSetsFromOptimizer()+1) }; foreach (CharacterSlot cs in Character.EquippableCharacterSlots) { newItemSet.Add(results.BestCharacter[cs]); } character.AddToItemSetList(newItemSet); } else { character.IsLoading = true; character.SetItems(results.BestCharacter); character.ActiveBuffs = results.BestCharacter.ActiveBuffs; if (CK_Talents_Points.IsChecked.GetValueOrDefault()) { character.CurrentTalents = results.BestCharacter.CurrentTalents; MainPage.Instance.TalentPicker.RefreshSpec(); } character.IsLoading = false; character.OnCalculationsInvalidated(); } DialogResult = true; } else ControlsEnabled(true); }
public static ObservableCollection<ItemSet> LoadItemSet() { ObservableCollection<ItemSet> list = new ObservableCollection<ItemSet>(); list.Add(new ItemSet() { ID = 0, Name = "无" }); using (FileStream stream = File.Open(DATA_PATH + "DBC/ItemSet.dbc", FileMode.Open)) { BinaryReader r = new BinaryReader(stream); DBCHeader header = DBC.ReadDBCHeader(r); int dataSize = 20 + header.RowSize * header.Records; for (int i = 0; i != header.Records; ++i) { ItemSet set = new ItemSet(); set.ID = r.ReadInt32(); set.Name = DBC.ReadString(r, dataSize, 16, 44); set.NameFlag = r.ReadInt32(); set.Item1 = r.ReadInt32(); set.Item2 = r.ReadInt32(); set.Item3 = r.ReadInt32(); set.Item4 = r.ReadInt32(); set.Item5 = r.ReadInt32(); set.Item6 = r.ReadInt32(); set.Item7 = r.ReadInt32(); set.Item8 = r.ReadInt32(); set.Item9 = r.ReadInt32(); set.Item10 = r.ReadInt32(); set.Item11 = r.ReadInt32(); set.Item12 = r.ReadInt32(); set.Item13 = r.ReadInt32(); set.Item14 = r.ReadInt32(); set.Item15 = r.ReadInt32(); set.Item16 = r.ReadInt32(); set.Item17 = r.ReadInt32(); set.Effect1 = r.ReadInt32(); set.Effect2 = r.ReadInt32(); set.Effect3 = r.ReadInt32(); set.Effect4 = r.ReadInt32(); set.Effect5 = r.ReadInt32(); set.Effect6 = r.ReadInt32(); set.Effect7 = r.ReadInt32(); set.Effect8 = r.ReadInt32(); set.Count1 = r.ReadInt32(); set.Count2 = r.ReadInt32(); set.Count3 = r.ReadInt32(); set.Count4 = r.ReadInt32(); set.Count5 = r.ReadInt32(); set.Count6 = r.ReadInt32(); set.Count7 = r.ReadInt32(); set.Count8 = r.ReadInt32(); set.Skill = r.ReadInt32(); set.SkillValue = r.ReadInt32(); list.Add(set); } r.Close(); } return list; }
protected Transformation(IEnumerable<string> allowedColumns) { var allowed = new ItemSet<StringValue>(allowedColumns.Select(e => new StringValue(e))); Parameters.Add(new ConstrainedValueParameter<StringValue>(ColumnParameterName, "Column used for the Transformation", allowed)); }
public static void ShowDialog(Character character, ItemSet thenewItemSet, EventHandler callback) { DG_ItemSetName window = new DG_ItemSetName(character, thenewItemSet); if (callback != null) window.Closed += callback; window.Show(); }
public void onCopyItemSet(ItemSet oldItemset) { var name = mView.askForName(); if (name == null) { return; } onDataChanged(); var itemSet = new ItemSet(oldItemset) { ItemSetName = name }; mBuildManager.addItemSet(itemSet); mView.addItemSet(itemSet); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcCurveStyleFont(IModel model, int label, bool activated) : base(model, label, activated) { _patternList = new ItemSet <IfcCurveStyleFontPattern>(this, 0, 2); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcShellBasedSurfaceModel(IModel model, int label, bool activated) : base(model, label, activated) { _sbsmBoundary = new ItemSet <IfcShell>(this, 0, 1); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcCompositeProfileDef(IModel model, int label, bool activated) : base(model, label, activated) { _profiles = new ItemSet <IfcProfileDef>(this, 0, 3); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcPropertyEnumeration(IModel model, int label, bool activated) : base(model, label, activated) { _enumerationValues = new ItemSet <IfcValue>(this, 0, 2); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcMaterialLayerSet(IModel model, int label, bool activated) : base(model, label, activated) { _materialLayers = new ItemSet <IfcMaterialLayer>(this, 0, 1); }
public ConstrainedValueParameter(string name, string description, ItemSet <T> validValues, T value) : base(name, description, validValues, value) { }
public ConstrainedValueParameter(string name, ItemSet <T> validValues, T value) : base(name, validValues, value) { }
public bool ItemSetListContainsItemSet(ItemSet IS) { if (itemSetList == null || itemSetList.Count <= 0) return false; bool contains = false; foreach (ItemSet ISs in itemSetList) { if (IS.Equals(ISs)) { contains = true; break; } } return contains; //return itemSetList.Contains(IS); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcPropertyListValue(IModel model, int label, bool activated) : base(model, label, activated) { _listValues = new ItemSet <IfcValue>(this, 0, 3); }
public RunCollectionContentConstraint() : base() { ConstraintData = new ItemSet<IRun>(); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcColourRgbList(IModel model, int label, bool activated) : base(model, label, activated) { _colourList = new ItemSet <IItemSet <IfcNormalisedRatioMeasure> >(this, 0, 1); }
public void onRenameItemSet(ItemSet data) { var name = mView.askForName(); if (name == null) { return; } onDataChanged(); mView.shouldPauseBinding = true; mView.updateItemSetName(name); mView.shouldPauseBinding = false; mBuildManager.updateItemSetName(data, name); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcRelCoversBldgElements(IModel model, int label, bool activated) : base(model, label, activated) { _relatedCoverings = new ItemSet <IfcCovering>(this, 0, 6); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcRepresentation(IModel model, int label, bool activated) : base(model, label, activated) { _items = new ItemSet <IfcRepresentationItem>(this, 0, 4); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcFillAreaStyle(IModel model, int label, bool activated) : base(model, label, activated) { _fillStyles = new ItemSet <IfcFillStyleSelect>(this, 0, 2); }
internal void InitializeTemplate() { if (Names == null) { Names = new string[(int)ClientLocale.End]; } if (Descriptions == null) { Descriptions = new string[(int)ClientLocale.End]; } if (DefaultDescription == null) { DefaultDescription = ""; } if (string.IsNullOrEmpty(DefaultName) || Id == 0) { // something's off with these entries return; } ItemId = (ItemId)Id; //Faction = (FactionId)Faction; // faction, 3.2.2 RequiredSkill = SkillHandler.Get(RequiredSkillId); Set = ItemMgr.GetSet(SetId); Lock = LockEntry.Entries.Get(LockId); RequiredFaction = FactionMgr.Get(RequiredFactionId); RequiredProfession = SpellHandler.Get(RequiredProfessionId); SubClassMask = (ItemSubClassMask)(1 << (int)SubClass); EquipmentSlots = ItemMgr.EquipmentSlotsByInvSlot.Get((uint)InventorySlotType); InventorySlotMask = (InventorySlotTypeMask)(1 << (int)InventorySlotType); IsAmmo = InventorySlotType == InventorySlotType.Ammo; IsKey = Class == ItemClass.Key; IsBag = InventorySlotType == InventorySlotType.Bag; IsContainer = Class == ItemClass.Container || Class == ItemClass.Quiver; // enchantables can't be stacked IsStackable = MaxAmount > 1 && RandomSuffixId == 0 && RandomPropertiesId == 0; IsTwoHandWeapon = InventorySlotType == InventorySlotType.TwoHandWeapon; SetIsWeapon(); if (ToolCategory != 0)// && TotemCategory != TotemCategory.SkinningKnife) { ItemMgr.FirstTotemsPerCat[(uint)ToolCategory] = this; } if (GemPropertiesId != 0) { GemProperties = EnchantMgr.GetGemproperties(GemPropertiesId); if (GemProperties != null) { GemProperties.Enchantment.GemTemplate = this; } } if (Sockets == null) { Sockets = new SocketInfo[ItemConstants.MaxSocketCount]; } else if (Sockets.Contains(sock => sock.Color != 0)) { HasSockets = true; } if (Damages == null) { Damages = DamageInfo.EmptyArray; } if (Resistances == null) { Resistances = new int[(int)DamageSchool.Count]; } if (SocketBonusEnchantId != 0) { SocketBonusEnchant = EnchantMgr.GetEnchantmentEntry(SocketBonusEnchantId); } switch (Class) { case ItemClass.Weapon: ItemProfession = ItemProfessions.WeaponSubClassProfessions.Get((uint)SubClass); break; case ItemClass.Armor: ItemProfession = ItemProfessions.ArmorSubClassProfessions.Get((uint)SubClass); break; } if (SheathType == SheathType.Undetermined) { // TODO: Read sheath-id from Item.dbc } // spells if (Spells != null) { ArrayUtil.Prune(ref Spells); for (int i = 0; i < 5; i++) { Spells[i].Index = (uint)i; Spells[i].FinalizeAfterLoad(); } } else { Spells = ItemSpell.EmptyArray; } UseSpell = Spells.Where(itemSpell => itemSpell.Trigger == ItemSpellTrigger.Use && itemSpell.Spell != null).FirstOrDefault(); if (UseSpell != null) { UseSpell.Spell.RequiredTargetType = RequiredTargetType; UseSpell.Spell.RequiredTargetId = RequiredTargetId; } EquipSpells = Spells.Where(spell => spell.Trigger == ItemSpellTrigger.Equip && spell.Spell != null).Select(itemSpell => itemSpell.Spell).ToArray(); SoulstoneSpell = Spells.Where(spell => spell.Trigger == ItemSpellTrigger.Soulstone && spell.Spell != null).Select(itemSpell => itemSpell.Spell).FirstOrDefault(); HitSpells = Spells.Where(spell => spell.Trigger == ItemSpellTrigger.ChanceOnHit && spell.Spell != null).Select(itemSpell => itemSpell.Spell).ToArray(); if (UseSpell != null && (UseSpell.Id == SpellId.Learning || UseSpell.Id == SpellId.Learning_2)) { // Teaching TeachSpell = Spells.Where(spell => spell.Trigger == ItemSpellTrigger.Consume).FirstOrDefault(); } ConsumesAmount = (Class == ItemClass.Consumable || Spells.Contains(spell => spell.Trigger == ItemSpellTrigger.Consume)) && (UseSpell == null || !UseSpell.HasCharges); IsHearthStone = UseSpell != null && UseSpell.Spell.IsHearthStoneSpell; IsInventory = InventorySlotType != InventorySlotType.None && InventorySlotType != InventorySlotType.Bag && InventorySlotType != InventorySlotType.Quiver && InventorySlotType != InventorySlotType.Relic; // find set if (SetId != 0) { var set = ItemMgr.Sets.Get((uint)SetId); if (set != null) { ArrayUtil.Add(ref set.Templates, this); } } // truncate arrays if (Mods != null) { ArrayUtil.TruncVals(ref Mods); } else { Mods = StatModifier.EmptyArray; } IsCharter = Flags.HasFlag(ItemFlags.Charter); RandomSuffixFactor = EnchantMgr.GetRandomSuffixFactor(this); if (IsCharter) { Creator = () => new PetitionCharter(); } else if (IsContainer) { Creator = () => new Container(); } else { Creator = () => new Item(); } }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcLightIntensityDistribution(IModel model, int label, bool activated) : base(model, label, activated) { _distributionData = new ItemSet <IfcLightDistributionData>(this, 0, 2); }
/// <summary> /// Returns the amount of Itesm of the given Set that the owner currently has equipped. /// </summary> /// <param name="set"></param> /// <returns></returns> public uint GetSetCount(ItemSet set) { uint setCount = 0; foreach (var template in set.Templates) { foreach (var setSlot in template.EquipmentSlots) { var item = Equipment[setSlot]; if (item != null && item.Template.Set == set) { setCount++; } } } return setCount; }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcTable(IModel model, int label, bool activated) : base(model, label, activated) { _rows = new ItemSet <IfcTableRow>(this, 0, 2); }
private void BuildCollectionOfItemSets() { // all items produced by Goto function will be automatically added to ItemSets and AutomatonGraphTable var initialSet = new List<Item> {new Item(mG.InitialProduction, 0)}; var initialItemSet = new ItemSet(mG, initialSet, ItemSets.Count); ItemSets.Add(initialItemSet, initialItemSet); ItemSetsList.Add(initialItemSet); var newSetArray = new ItemSet[mG.GrammarSymbols.Count]; mAutomatonGraphTable.Add(newSetArray); var collection = new List<ItemSet> {initialItemSet}; List<ItemSet> accumulator; do { accumulator = new List<ItemSet>(); foreach (ItemSet set in collection) { for (int i = 0; i < mG.GrammarSymbols.Count; i++) { ItemSet goTo = Goto(set, i); if (goTo != null) { if (!ItemSets.ContainsKey(goTo)) { ItemSets.Add(goTo, goTo); ItemSetsList.Add(goTo); accumulator.Add(goTo); } else goTo = ItemSets[goTo]; if (mAutomatonGraphTable.Count > set.ID) { mAutomatonGraphTable[set.ID][i] = goTo; } else { newSetArray = new ItemSet[mG.GrammarSymbols.Count]; newSetArray[i] = goTo; mAutomatonGraphTable.Add(newSetArray); } } } if (mAutomatonGraphTable.Count == set.ID) { newSetArray = new ItemSet[mG.GrammarSymbols.Count]; mAutomatonGraphTable.Add(newSetArray); } } collection = accumulator; } while (accumulator.Count > 0); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcFaceBasedSurfaceModel(IModel model, int label, bool activated) : base(model, label, activated) { _fbsmFaces = new ItemSet <IfcConnectedFaceSet>(this, 0, 1); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcTrimmedCurve(IModel model, int label, bool activated) : base(model, label, activated) { _trim1 = new ItemSet <IfcTrimmingSelect>(this, 2, 2); _trim2 = new ItemSet <IfcTrimmingSelect>(this, 2, 3); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcTriangulatedFaceSet(IModel model, int label, bool activated) : base(model, label, activated) { _coordIndex = new ItemSet <IItemSet <IfcPositiveInteger> >(this, 0, 4); _normalIndex = new OptionalItemSet <IItemSet <IfcPositiveInteger> >(this, 0, 5); }
/// <summary> /// Remove an ItemSet to the ItemSetList for this Character. /// ItemSets are for the Comparison chart. /// It will run the Remove command until it stops finding the set in the ItemSetList, in case its there multiple times /// </summary> /// <param name="newset"></param> public void RemoveFromItemSetList(ItemSet newset) { if (itemSetList == null) return; // Using a While in case it's been added multiple times by accident bool didsomething = false; while (ItemSetListContainsItemSetByName(newset.Name)) { itemSetList.RemoveAll(set => (set.Name == newset.Name)); didsomething |= true; } if (didsomething) { OnCalculationsInvalidated(); } }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcDirection(IModel model, int label, bool activated) : base(model, label, activated) { _directionRatios = new ItemSet <IfcReal>(this, 3, 1); }
/// <summary>Warning! Retuns NULL when it can't find the set</summary> public ItemSet GetItemSetByName(String name) { if (name == "Current") { ItemSet current = new ItemSet(); foreach (CharacterSlot cs in Character.EquippableCharacterSlots) { current.Add(this[cs]); } current.Name = "Current"; return current; } if (itemSetList == null || itemSetList.Count <= 0) { return null; } if (ItemSetListContainsItemSetByName(name)) { foreach (ItemSet ISs in itemSetList) { if (ISs.Name.Equals(name)) { return ISs; } } } return null; }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcPresentationStyleAssignment(IModel model, int label, bool activated) : base(model, label, activated) { _styles = new ItemSet <IfcPresentationStyleSelect>(this, 0, 1); }
public static ItemSet generate(PurchaseSetKey setKey, ChampionPurchaseCalculator stats) { //Lookup the champion var championKey = StaticDataStore.Champions.Keys[setKey.ChampionId]; var championInfo = StaticDataStore.Champions.Champions[championKey]; // Create the set and key it ItemSet itemSet = new ItemSet(); itemSet.SetKey = setKey; itemSet.MatchCount = stats.MatchCount; //Come up with an item set title itemSet.title = championInfo.Name + " " + ItemSetNaming.ToolName; //Add a nice description of how this was generated itemSet.description = "Pro item set generated using " + stats.MatchCount.ToString() + " challenger/master matches."; //Fill out a bunch of other stuff that is the same for this tool itemSet.type = type; itemSet.map = map; itemSet.mode = mode; itemSet.priority = priority; itemSet.sortrank = sortRank < 0 ? 0 : sortRank; // Block info var blockData = new[] { new { Name = "Starting Items", Stage = GameStage.Start }, new { Name = "Early Items", Stage = GameStage.Early }, new { Name = "Midgame Items", Stage = GameStage.Mid }, new { Name = "Lategame Items", Stage = GameStage.Late } }; // Create blocks and filter to non-empty blocks var blocks = blockData .Where(blockInfo => stats.Purchases.ContainsKey(blockInfo.Stage)) .Select(blockInfo => new ItemSet.Block(blockInfo.Name) { items = stats.Purchases[blockInfo.Stage].Select(entry => new ItemSet.Item(entry.ItemId.ToString()) { count = 1, percentage = entry.Percentage }).ToList() }) .Where(block => block.items.Count > 0).ToList(); // Combine adjacent items blocks.ForEach(block => { for (int i = 0; i < block.items.Count - 1; ++i) { if (block.items[i].id == block.items[i + 1].id) { // Remove when adjacent, and keep the lower percentage block.items[i].count = block.items[i].count + 1; block.items.RemoveAt(i+1); --i; } } }); // Add blocks to item set itemSet.blocks = blocks; return itemSet; }
public ItemCollection() { this._items = new ItemSet(); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcPropertySetTemplate(IModel model, int label, bool activated) : base(model, label, activated) { _hasPropertyTemplates = new ItemSet <IfcPropertyTemplate>(this, 0, 7); }
public ItemCollection(List <Item> items) { this._items = new ItemSet(items); }
public void onDeleteItemSet(ItemSet item) { onDataChanged(); mBuildManager.removeItemSet(item); }
private string ValidateAndCreateUrl(ItemSet results, string filter, string token) { return(CheckAlphaNumeric(token) && !string.IsNullOrEmpty(token) ? Url.Link("DefaultApi", new { Controller = "Items", filter, pageToken = token }) : string.Empty); }
public void onItemSetChanged(ItemSet value) { onDataChanged(); mBuildManager.updateItemSet(value); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcUnitAssignment(IModel model, int label, bool activated) : base(model, label, activated) { _units = new ItemSet <IfcUnit>(this, 0, 1); }
public void updateProperty(ItemSet itemSet, object control) { switch (mProp) { case Prop.Item1: itemSet.Item1 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item2: itemSet.Item2 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item3: itemSet.Item3 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item4: itemSet.Item4 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item5: itemSet.Item5 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item6: itemSet.Item6 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item7: itemSet.Item7 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item8: itemSet.Item8 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item9: itemSet.Item9 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item10: itemSet.Item10 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item11: itemSet.Item11 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item12: itemSet.Item12 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item13: itemSet.Item13 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item14: itemSet.Item14 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item15: itemSet.Item15 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item16: itemSet.Item16 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item17: itemSet.Item17 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item18: itemSet.Item18 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item19: itemSet.Item19 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item20: itemSet.Item20 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item21: itemSet.Item21 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item22: itemSet.Item22 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item23: itemSet.Item23 = (Item)((ComboBox)control).SelectedItem; break; case Prop.Item24: itemSet.Item24 = (Item)((ComboBox)control).SelectedItem; break; } }
public ItemInfo(BinaryReader reader, int version = int.MaxValue, int Customversion = int.MaxValue) { Index = reader.ReadInt32(); Name = reader.ReadString(); Type = (ItemType) reader.ReadByte(); if (version >= 40) Grade = (ItemGrade)reader.ReadByte(); RequiredType = (RequiredType) reader.ReadByte(); RequiredClass = (RequiredClass) reader.ReadByte(); RequiredGender = (RequiredGender) reader.ReadByte(); if(version >= 17) Set = (ItemSet)reader.ReadByte(); Shape = version >= 30 ? reader.ReadInt16() : reader.ReadSByte(); Weight = reader.ReadByte(); Light = reader.ReadByte(); RequiredAmount = reader.ReadByte(); Image = reader.ReadUInt16(); Durability = reader.ReadUInt16(); StackSize = reader.ReadUInt32(); Price = reader.ReadUInt32(); MinAC = reader.ReadByte(); MaxAC = reader.ReadByte(); MinMAC = reader.ReadByte(); MaxMAC = reader.ReadByte(); MinDC = reader.ReadByte(); MaxDC = reader.ReadByte(); MinMC = reader.ReadByte(); MaxMC = reader.ReadByte(); MinSC = reader.ReadByte(); MaxSC = reader.ReadByte(); if (version < 25) { HP = reader.ReadByte(); MP = reader.ReadByte(); } else { HP = reader.ReadUInt16(); MP = reader.ReadUInt16(); } Accuracy = reader.ReadByte(); Agility = reader.ReadByte(); Luck = reader.ReadSByte(); AttackSpeed = reader.ReadSByte(); StartItem = reader.ReadBoolean(); BagWeight = reader.ReadByte(); HandWeight = reader.ReadByte(); WearWeight = reader.ReadByte(); if (version >= 9) Effect = reader.ReadByte(); if (version >= 20) { Strong = reader.ReadByte(); MagicResist = reader.ReadByte(); PoisonResist = reader.ReadByte(); HealthRecovery = reader.ReadByte(); SpellRecovery = reader.ReadByte(); PoisonRecovery = reader.ReadByte(); HPrate = reader.ReadByte(); MPrate = reader.ReadByte(); CriticalRate = reader.ReadByte(); CriticalDamage = reader.ReadByte(); byte bools = reader.ReadByte(); NeedIdentify = (bools & 0x01) == 0x01; ShowGroupPickup = (bools & 0x02) == 0x02; ClassBased = (bools & 0x04) == 0x04; LevelBased = (bools & 0x08) == 0x08; CanMine = (bools & 0x10) == 0x10; MaxAcRate = reader.ReadByte(); MaxMacRate = reader.ReadByte(); Holy = reader.ReadByte(); Freezing = reader.ReadByte(); PoisonAttack = reader.ReadByte(); if (version < 55) { Bind = (BindMode)reader.ReadByte(); } else { Bind = (BindMode)reader.ReadInt16(); } } if (version >= 21) { Reflect = reader.ReadByte(); HpDrainRate = reader.ReadByte(); Unique = (SpecialItemMode)reader.ReadInt16(); } if (version >= 24) { RandomStatsId = reader.ReadByte(); } else { RandomStatsId = 255; if ((Type == ItemType.Weapon) || (Type == ItemType.Armour) || (Type == ItemType.Helmet) || (Type == ItemType.Necklace) || (Type == ItemType.Bracelet) || (Type == ItemType.Ring) || (Type == ItemType.Mount)) RandomStatsId = (byte)Type; if ((Type == ItemType.Belt) || (Type == ItemType.Boots)) RandomStatsId = 7; } if (version >= 40) CanFastRun = reader.ReadBoolean(); if (version >= 41) { CanAwakening = reader.ReadBoolean(); bool isTooltip = reader.ReadBoolean(); if (isTooltip) ToolTip = reader.ReadString(); } }
public GradientBoostingRegressionAlgorithm() { Problem = new RegressionProblem(); // default problem var osgp = CreateOSGP(); var regressionAlgs = new ItemSet<IAlgorithm>(new IAlgorithm[] { new RandomForestRegression(), osgp, }); foreach (var alg in regressionAlgs) alg.Prepare(); Parameters.Add(new FixedValueParameter<IntValue>(IterationsParameterName, "Number of iterations", new IntValue(100))); Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); Parameters.Add(new FixedValueParameter<DoubleValue>(NuParameterName, "The learning rate nu when updating predictions in GBM (0 < nu <= 1)", new DoubleValue(0.5))); Parameters.Add(new FixedValueParameter<DoubleValue>(RParameterName, "The fraction of rows that are sampled randomly for the base learner in each iteration (0 < r <= 1)", new DoubleValue(1))); Parameters.Add(new FixedValueParameter<DoubleValue>(MParameterName, "The fraction of variables that are sampled randomly for the base learner in each iteration (0 < m <= 1)", new DoubleValue(0.5))); Parameters.Add(new ConstrainedValueParameter<IAlgorithm>(RegressionAlgorithmParameterName, "The regression algorithm to use as a base learner", regressionAlgs, osgp)); Parameters.Add(new FixedValueParameter<StringValue>(RegressionAlgorithmSolutionResultParameterName, "The name of the solution produced by the regression algorithm", new StringValue("Solution"))); Parameters[RegressionAlgorithmSolutionResultParameterName].Hidden = true; Parameters.Add(new FixedValueParameter<BoolValue>(CreateSolutionParameterName, "Flag that indicates if a solution should be produced at the end of the run", new BoolValue(true))); Parameters[CreateSolutionParameterName].Hidden = true; Parameters.Add(new FixedValueParameter<BoolValue>(StoreRunsParameterName, "Flag that indicates if the results of the individual runs should be stored for detailed analysis", new BoolValue(false))); Parameters[StoreRunsParameterName].Hidden = true; }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcStructuralSurfaceMemberVarying(IModel model, int label, bool activated) : base(model, label, activated) { _subsequentThickness = new ItemSet <IfcPositiveLengthMeasure>(this, 0, 10); }
private void AddChart(ItemSet item) { this.flowChartPanel.Controls.Add(item); }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcSurfaceStyle(IModel model, int label, bool activated) : base(model, label, activated) { _styles = new ItemSet <IfcSurfaceStyleElementSelect>(this, 5, 3); }
private void DiscoverBenchmarks() { var benchmarks = from t in ApplicationManager.Manager.GetTypes(typeof(IBenchmark)) select t; ItemSet<IBenchmark> values = new ItemSet<IBenchmark>(); foreach (var benchmark in benchmarks) { IBenchmark b = (IBenchmark)Activator.CreateInstance(benchmark); values.Add(b); } string paramName = "Benchmark"; if (!Parameters.ContainsKey(paramName)) { if (values.Count > 0) { Parameters.Add(new ConstrainedValueParameter<IBenchmark>(paramName, "The benchmark which should be executed.", values, values.First(a => a is IBenchmark))); } else { Parameters.Add(new ConstrainedValueParameter<IBenchmark>(paramName, "The benchmark which should be executed.", values)); } } }
internal ItemSet Goto(ItemSet itemSet, int grammarSymbolID) { var gotoKernel = new List<Item>(); foreach (Item item in itemSet) if (item.NextToDotSymbol == mG.GrammarSymbols[grammarSymbolID]) gotoKernel.Add(new Item(item.Production, item.DotPosition + 1)); return (gotoKernel.Count > 0) ? new ItemSet(mG, gotoKernel, ItemSets.Count) : null; }
/// <summary> /// Create a changegroup that contains all change actions needed to bring a migration target to the specificed snapshot /// </summary> /// <param name="changeGroupName">The change group name of the snapshot</param> private void generateSnapshotForVCSession() { foreach (var setting in ConfigurationService.VcCustomSetting.Settings.Setting) { if (setting.SettingKey == "SnapshotStartPoint") { m_sessionLevelSnapshotChangeset = parseSnapShotStartPoint(setting.SettingValue); } else if (setting.SettingKey == "SnapshotBatchSize") { try { m_snapshotCheckinBatchSize = int.Parse(setting.SettingValue); } catch (Exception) { // wrong format, use the default batch size } } } m_hwmDelta.Reload(); if (m_hwmDelta.Value >= m_sessionLevelSnapshotChangeset) { // We've already passed snapshot changeset Id, just return. m_sessionlevelSnapshotCompleted = true; return; } VersionSpec snapshotVersionSpec = new ChangesetVersionSpec(m_sessionLevelSnapshotChangeset); List <string> pathsToGet = new List <string>(); foreach (MappingEntry mappingEntry in ConfigurationService.Filters) { if (mappingEntry.Cloak) { continue; } // Always query at one level down the mapping ItemSet itemSet = m_tfsClient.GetItems(mappingEntry.Path, snapshotVersionSpec, RecursionType.OneLevel); Item[] items = itemSet.Items; foreach (Item childItem in items) { // Avoid the item itself. if (!VersionControlPath.Equals(childItem.ServerItem, mappingEntry.Path)) { pathsToGet.Add(childItem.ServerItem); } } } int countDownToCreateNewChangeGroup = m_snapshotCheckinBatchSize; int batchExecutionOrder = m_sessionLevelSnapshotChangeset; ChangeGroup batchGroup = createChangeGroupForSnapshot(m_sessionLevelSnapshotChangeset, batchExecutionOrder); foreach (string path in pathsToGet) { TraceManager.TraceInformation("Getting snapshot at changeset: {0}, path: {1}", m_sessionLevelSnapshotChangeset, path); ItemSet itemSet = m_tfsClient.GetItems(path, snapshotVersionSpec, RecursionType.Full); Item[] items = itemSet.Items; itemSet = null; TraceManager.TraceInformation("Snapshot contains {0} items", items.Length); for (int i = 0; i < items.Length; i++) { // We want to include the situation where a snapshot on a path is the same as the snapshot of the VC session. // In this situation, we want to include the item in the session snapshot changeset. // So we use changesetId + 1 as the reference changeset id. if (IsPathMapped(items[i].ServerItem, m_sessionLevelSnapshotChangeset + 1) == MappingResult.Mapped) { countDownToCreateNewChangeGroup--; if (countDownToCreateNewChangeGroup == 0) { TraceManager.TraceInformation("Saving {0} change actions", m_snapshotCheckinBatchSize); batchGroup.Save(); batchGroup.Actions.Clear(); batchGroup = null; batchExecutionOrder--; batchGroup = createChangeGroupForSnapshot(m_sessionLevelSnapshotChangeset, batchExecutionOrder); countDownToCreateNewChangeGroup = m_snapshotCheckinBatchSize; TraceManager.TraceInformation("Saved {0} change actions", m_snapshotCheckinBatchSize); } batchGroup.CreateAction( WellKnownChangeActionId.Add, new TfsMigrationItem(items[i]), null, items[i].ServerItem, null, null, TfsAnalysisAlgorithms.convertContentType(items[i].ItemType), null); } items[i] = null; // Dispose this object to reduce memory consumption. } } if (batchGroup.Actions.Count > 0) { int numRemainingItems = batchGroup.Actions.Count; TraceManager.TraceInformation("Saving {0} change actions", numRemainingItems); batchGroup.Save(); TraceManager.TraceInformation("Saved {0} change actions", numRemainingItems); } m_hwmDelta.Update(m_sessionLevelSnapshotChangeset); m_changeGroupService.PromoteDeltaToPending(); m_sessionlevelSnapshotCompleted = true; }
//internal constructor makes sure that objects are not created outside of the model/ assembly controlled area internal IfcRelDefinesByType(IModel model, int label, bool activated) : base(model, label, activated) { _relatedObjects = new ItemSet <IfcObject>(this, 0, 5); }
private void UpdateGraphItemSets(string subgraph) { SetGraphControl(ComparisonGraph); CGL_Legend.LegendItems = Calculations.SubPointNameColors; ComparisonGraph.LegendItems = Calculations.SubPointNameColors; ComparisonGraph.Mode = ComparisonGraph.DisplayMode.Subpoints; List<ComparisonCalculationBase> setCalculations = new List<ComparisonCalculationBase>(); ItemSet newItemSetNaked = new ItemSet() { Name = "Naked", }; foreach (CharacterSlot cs in Character.EquippableCharacterSlots) { newItemSetNaked.Add(null); } if (!Character.ItemSetListContainsItemSet(newItemSetNaked)) { setCalculations.Add(Calculations.GetItemSetCalculations(newItemSetNaked, Character)); } ItemSet newItemSetCurrent = new ItemSet() { Name = "Current", }; foreach (CharacterSlot cs in Character.EquippableCharacterSlots) { newItemSetCurrent.Add(Character[cs]); } if (!Character.ItemSetListContainsItemSet(newItemSetCurrent)) { setCalculations.Add(Calculations.GetItemSetCalculations(newItemSetCurrent, Character)); } foreach (ItemSet IS in Character.GetItemSetList()) { if (IS == null) { continue; } setCalculations.Add(Calculations.GetItemSetCalculations(IS, Character)); } // Now Push the results to the screen ComparisonGraph.DisplayCalcs(_itemSetCalculations = setCalculations.ToArray()); }
public void ShowModifiedFiles(Workspace workspace, string path) { char[] charsToTrim = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }; string itemPath = path.TrimEnd(charsToTrim); workspace.RefreshMappings(); string serverPath = workspace.GetServerItemForLocalItem(itemPath); // pull item list based on WorkspaceVersion. otherwise might get // new items on server that haven't been pulled yet in the list returned WorkspaceVersionSpec version = new WorkspaceVersionSpec(workspace); // get item list from TFS server ItemSpec itemSpec = new ItemSpec(itemPath, RecursionType.Full); ItemSet itemSet = VersionControlServer.GetItems(itemSpec, version, DeletedState.NonDeleted, ItemType.Any, true); Item[] items = itemSet.Items; foreach (Item item in items) { if (item.ItemType != ItemType.File) { continue; } if (item.ServerItem.Length == serverPath.Length) { continue; } string serverItem = item.ServerItem.Remove(0, serverPath.Length + 1); // server item paths are separated with '/', but on windows the file list below has '\' separated paths if (Path.DirectorySeparatorChar != '/') { serverItem = serverItem.Replace('/', Path.DirectorySeparatorChar); } // only looking for modifications, not deletes or adds string fname = Path.Combine(itemPath, serverItem); if (!File.Exists(fname)) { continue; } if (FileAttributes.ReadOnly == (File.GetAttributes(fname) & FileAttributes.ReadOnly)) { continue; } using (FileStream fileStream = new FileStream(fname, FileMode.Open, FileAccess.Read)) { string localHash = Convert.ToBase64String(md5.ComputeHash(fileStream)); string itemHash = Convert.ToBase64String(item.HashValue); if (itemHash == localHash) { continue; } } string p = fname.Substring(path.Length + 1); if (OptionBrief) { Driver.WriteLine(CanonicalPath(p)); continue; } string tnameA = Path.GetTempFileName(); item.DownloadFile(tnameA); IDiffItem a = new DiffItemLocalFile(tnameA, item.Encoding, DateTime.Now, false); IDiffItem b = new DiffItemLocalFile(fname, item.Encoding, DateTime.Now, false); Difference.DiffFiles(VersionControlServer, a, b, GetDiffOptions(), p, true); if (!String.IsNullOrEmpty(tnameA)) { File.Delete(tnameA); } } }