Exemplo n.º 1
0
        private void AddComponents(ItemComponent handle, int level = -1)
        {
            var componentsToAdd = Random.NextInt(1, handle.Connectors.Count);

            for (var i = 0; i < componentsToAdd; i++)
            {
                if (!handle.CanAddComponent())
                {
                    break;
                }

                var component = level < 0 ? componentFactory.Create() : componentFactory.CreateWithItemLevel(level);

                handle.AddComponent(component);
            }
        }