public void Add(List <FactorioObject> raw, DependencyList.Flags flags) { var elems = new FactorioId[raw.Count]; for (var i = 0; i < raw.Count; i++) { elems[i] = raw[i].id; } list.Add(new DependencyList { elements = elems, flags = flags }); }
public override void GetDependencies(IDependencyCollector collector) { if (ingredients.Length > 0) { var ingList = new FactorioId[ingredients.Length]; for (var i = 0; i < ingredients.Length; i++) { ingList[i] = ingredients[i].goods.id; } collector.Add(ingList, DependencyList.Flags.Ingredient); } collector.Add(crafters, DependencyList.Flags.CraftingEntity); if (sourceEntity != null) { collector.Add(new[] { sourceEntity.id }, DependencyList.Flags.SourceEntity); } if (!enabled) { collector.Add(technologyUnlock, DependencyList.Flags.TechnologyUnlock); } }
public static ulong GetMilestoneOrder(FactorioId id) { var ms = Milestones.Instance; return((ms.milestoneResult[id] - 1) & ms.lockedMask); }
public T this[FactorioId id] => all[(int)id - start];
public bool IsAccessibleWithCurrentMilesones(FactorioId obj) => (milestoneResult[obj] & lockedMask) == 1;