Ejemplo n.º 1
0
            internal PrefabSelectionCandidate CreateWithoutSet(PrefabSet exclude, PrefabMapping newMapping)
            {
                var sets     = FreeSets.Except(exclude);
                var mappings = new List <PrefabMapping>(Mappings)
                {
                    newMapping
                };

                return(new PrefabSelectionCandidate(sets, mappings));
            }
        internal PrefabSelectionCandidate CreateWithoutPrefab(Prefab exclude, PrefabMapping newMapping)
        {
            var blacklistedPrefabNames = FreeSets
                                         .Where(x => x.ContainsPrefab(exclude))
                                         .SelectMany(x => x)
                                         .Select(x => x.Name)
                                         .ToHashSet();

            var sets = FreeSets
                       .Select(x => x.CreateWithoutPrefabNames(blacklistedPrefabNames))
                       .Where(x => !x.IsEmpty)
                       .ToList();

            var mappings = new List <PrefabMapping>(Mappings)
            {
                newMapping
            };

            return(new PrefabSelectionCandidate(sets, mappings));
        }
 public override string ToString()
 {
     return($"{nameof(PrefabSelectionCandidate)}[freeSets={FreeSets.JoinAsString()},mappings=[{Mappings.JoinAsString()}]]");
 }