public InstanceContentData(InstanceContent instanceContent) { if (instanceContent == null) throw new ArgumentNullException("instanceContent"); this.InstanceContent = instanceContent; var coll = instanceContent.Sheet.Collection; if (!coll.IsLibraAvailable) return; var libraRow = coll.Libra.InstanceContents.FirstOrDefault(i => i.Key == instanceContent.Key); if (libraRow != null) Parse(libraRow); }
public InstanceContentData(InstanceContent instanceContent) { this.InstanceContent = instanceContent ?? throw new ArgumentNullException("instanceContent"); var coll = instanceContent.Sheet.Collection; if (!coll.IsLibraAvailable) { return; } // Now inaccurate. //var libraRow = coll.Libra.InstanceContents.FirstOrDefault(i => i.Key == instanceContent.Key); //if (libraRow != null) // Parse(libraRow); }
internal InstanceContentRequirement(Quest quest) { const int QuestCount = 3; this.Type = (PrerequisiteQuestsRequirementType)quest.AsInt32("InstanceContentJoin"); List <InstanceContent> contents = new List <InstanceContent>(); for (int i = 0; i < QuestCount; ++i) { InstanceContent c = quest.As <InstanceContent>("InstanceContent", i); if (c.Key != 0) { contents.Add(c); } } this.InstanceContents = contents; }
public InstanceContentData(InstanceContent instanceContent) { if (instanceContent == null) { throw new ArgumentNullException("instanceContent"); } this.InstanceContent = instanceContent; var coll = instanceContent.Sheet.Collection; if (!coll.IsLibraAvailable) { return; } var libraRow = coll.Libra.InstanceContents.FirstOrDefault(i => i.Key == instanceContent.Key); if (libraRow != null) { Parse(libraRow); } }
JObject CreateTreasureCoffer(dynamic instance, IEnumerable <Saint.InstanceContentData.Treasure> sTreasures, Saint.InstanceContent sInstanceContent, HashSet <int> treasureSet) { dynamic treasures = new JObject(); var treasureItems = new JArray(); treasures.items = treasureItems; foreach (var sTreasure in sTreasures) { if (sTreasure.Coordinates != null) { treasures.coords = new JArray { sTreasure.Coordinates.Value.X, sTreasure.Coordinates.Value.Y }; } foreach (var sItem in sTreasure.Items) { if (treasureItems.Any(i => (int)i == sItem.Key)) { continue; } treasureSet.Add(sItem.Key); treasureItems.Add(sItem.Key); var item = _builder.Db.ItemsById[sItem.Key]; if (item.instances == null) { item.instances = new JArray(); } JArray itemInstances = item.instances; if (!itemInstances.Any(i => (int)i == sInstanceContent.Key)) { itemInstances.Add(sInstanceContent.Key); } _builder.Db.AddReference(instance, "item", sItem.Key, false); _builder.Db.AddReference(item, "instance", (string)instance.id, true); } } return(treasureItems.Count > 0 ? treasures : null); }
public InstanceContentData(InstanceContent instanceContent) { }