Example #1
0
        private List <Filling <T> > GetFillings <T>(List <Filling <T> > fillingsOld) where T : class, IAbbreviation
        {
            List <Filling <T> > fillingsNew = new List <Filling <T> >();

            foreach (var fillingOld in fillingsOld)
            {
                Filling <T> fillingNew = new Filling <T>();
                fillingNew.Value            = fillingOld.Value;
                fillingNew.PossibleFillings = new List <PossibleFilling>();
                foreach (var fillingOldPossibleFilling in fillingOld.PossibleFillings)
                {
                    if (fillingOldPossibleFilling.BusyPair != null)
                    {
                        BusyPair busyPairFree = new BusyPair(new Classroom(), fillingOldPossibleFilling.BusyPair.Subject, new Group());
                        fillingNew.PossibleFillings.Add(new PossibleFilling(fillingOldPossibleFilling.Pair, fillingOldPossibleFilling.StudyDay)
                        {
                            BusyPair = busyPairFree
                        });
                    }
                    else
                    {
                        fillingNew.PossibleFillings.Add(new PossibleFilling(fillingOldPossibleFilling.Pair, fillingOldPossibleFilling.StudyDay));
                    }
                }
                fillingsNew.Add(fillingNew);
            }
            return(fillingsNew);
        }
Example #2
0
        public object Clone()
        {
            T newValue = Value.Clone() as T;

            List <PossibleFilling> newPossibleFillings = new  List <PossibleFilling>();

            for (int i = 0; i < PossibleFillings.Count; i++)
            {
                newPossibleFillings.Add(PossibleFillings[i].Clone() as PossibleFilling);
            }
            Filling <T> newFilling = new Filling <T>(newValue, newPossibleFillings);

            return(newFilling);
        }