Esempio n. 1
0
 static public void ClearEnsembles()
 {
     Ensemble.Clear();
     EnsemblePrep.Clear();
     EnsembleAnnul.Clear();
     EnsembleDone.Clear();
 }
        private Ensemble GenerateGroupings(Ensemble eIn, List <Books> books)
        {
            if (books.Count == 0)
            {
                return(eIn);
            }
            var e          = new Ensemble();
            var book       = books[0];
            var otherBooks = books.Skip(1).ToList();

            if (eIn.Count == 0)
            {
                var b = new Bundle();
                b.Add(book);
                var gAlone = new Grouping();
                gAlone.Add(b);
                e.Add(gAlone);
                return(GenerateGroupings(e, otherBooks));
            }
            else
            {
                foreach (var grouping in eIn)
                {
                    var nbBundles = grouping.Count();
                    for (var iBundle = 0; iBundle < nbBundles; iBundle++)
                    {
                        var bundle = grouping[iBundle];
                        if (bundle.CanAccept(book))
                        {
                            var enrichedGrouping = grouping.Clone();
                            var clonedBundle     = enrichedGrouping[iBundle];
                            clonedBundle.Add(book);
                            e.Add(enrichedGrouping);
                        }
                    }
                    var clonedGrouping = grouping.Clone();
                    var b = new Bundle();
                    b.Add(book);
                    clonedGrouping.Add(b);
                    e.Add(clonedGrouping);
                }
                //Console.WriteLine(e.Count);
                eIn.Clear();
                return(GenerateGroupings(e, otherBooks));
            }
        }
Esempio n. 3
0
    public void Clear()
    {
        // pomazat vsetko
        foreach (GameObject go in samplesRepreGO)
        {
            samplesRepreGO.Remove(go);
            GameObject.DestroyImmediate(go);
        }

        if (GameObject.Find("Composition Preview") != null)
        {
            GameObject.DestroyImmediate(GameObject.Find("Composition Preview"));
        }

        if (GameObject.Find("Composition") != null)
        {
            GameObject.DestroyImmediate(GameObject.Find("Composition"));
        }

        // poresetovat vsetko
        ensemble.Clear();

        samplesIDs.Clear();
        samplesRepre.Clear();
        samplesRepreGO.Clear();
        samplesAbsoluteMeasures.Clear();
        samplesDeltaMeasures.Clear();
        samplesDeltaMeasuresDic.Clear();

        GameObject.DestroyImmediate(compositionGameObject);

        isInitialized        = false;
        isLoaded             = false;
        wasLayoutChanged     = false;
        isCompositionCreated = false;
    }