Ejemplo n.º 1
0
 public void InitCombo(WorkshopInitializedCombo combo)
 {
     if (_initializedCombos.Add(combo))
     {
         // This if block will run if 'combo' was not yet initialized.
         combo.Init();
         _stackCount = Math.Max(_stackCount, combo.StackOffset + combo.StackLength);
     }
 }
Ejemplo n.º 2
0
        public ClassProviderComboCollection(ClassWorkshopInitializerComponent initializer, ClassInitializer provider, IReadOnlyList <TypeArgCombo> combos)
        {
            Provider     = provider;
            _initializer = initializer;

            foreach (var combo in combos)
            {
                // Instantiate the combo.
                var instance = (ClassType)Provider.GetInstance(new GetInstanceInfo(combo.TypeArgs));

                // No group was created yet.
                var group = GetCompatible(combo);
                if (group == null)
                {
                    group = new WorkshopInitializedCombo(initializer, instance, combo, initializer.AssignID());
                    _initializedCombos.Add(group);
                }

                // Create the relation.
                initializer.AddRelation(new ClassWorkshopRelation(group, instance));
            }
        }
Ejemplo n.º 3
0
 public ClassWorkshopRelation(WorkshopInitializedCombo combo, ClassType instance)
 {
     Combo    = combo;
     Instance = instance;
 }