Esempio n. 1
0
            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
                });
            }
Esempio n. 2
0
 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);
     }
 }
Esempio n. 3
0
        public static ulong GetMilestoneOrder(FactorioId id)
        {
            var ms = Milestones.Instance;

            return((ms.milestoneResult[id] - 1) & ms.lockedMask);
        }
Esempio n. 4
0
 public T this[FactorioId id] => all[(int)id - start];
Esempio n. 5
0
 public bool IsAccessibleWithCurrentMilesones(FactorioId obj) => (milestoneResult[obj] & lockedMask) == 1;