Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Post post1 = new Post(
                "Yves Saint-Laurent, was a French fashion designer who, in 1961, founded his eponymous fashion label. He is regarded as being among the foremost fashion designers in the twentieth century.[2] In 1985, Caroline Rennolds Milbank wrote, \"The most consistently celebrated and influential designer of the past twenty-five years, Yves Saint Laurent can be credited with both spurring the couture's rise from its 1960s ashes and with finally rendering ready-to-wear reputable.",
                DateTime.Now
                );

            Post post2 = new Post(
                "Yves Saint-Laurent, was a French fashion designer who, in 1961, founded his eponymous fashion label. He is regarded as being among the foremost fashion designers in the twentieth century.[2] In 1985, Caroline Rennolds Milbank wrote, \"The most consistently celebrated and influential designer of the past twenty-five years, Yves Saint Laurent can be credited with both spurring the couture's rise from its 1960s ashes and with finally rendering ready-to-wear reputable.",
                DateTime.Now
                );

            Post post3 = new Post(
                "Yves Saint-Laurent, was a French fashion designer who, in 1961, founded his eponymous fashion label. He is regarded as being among the foremost fashion designers in the twentieth century.[2] In 1985, Caroline Rennolds Milbank wrote, \"The most consistently celebrated and influential designer of the past twenty-five years, Yves Saint Laurent can be credited with both spurring the couture's rise from its 1960s ashes and with finally rendering ready-to-wear reputable.",
                DateTime.Now
                );

            Faculty FIT        = new FIT();
            Decanat KNUDecanat = new Decanat();

            KNUDecanat.RegisterObserver(FIT);
            KNUDecanat.News.Add(post1);
            KNUDecanat.NotifyObservers();

            FIT.PostNews();
            Thread.Sleep(3000);

            KNUDecanat.News.Add(post2);
            KNUDecanat.NotifyObservers();

            FIT.PostNews();
            Thread.Sleep(3000);

            KNUDecanat.News.Add(post3);
            KNUDecanat.NotifyObservers();

            FIT.PostNews();
            Thread.Sleep(3000);

            Console.ReadKey();
        }
Exemplo n.º 2
0
 public void Update()
 {
     if (Decanat.Instance().Forgotters.ContainsKey(this.Name))
     {
         foreach (var teacher in Decanat.Instance().Forgotters[this.Name])
         {
             if (BadTeachers.ContainsKey(StudyWeek.Instance().Num))
             {
                 BadTeachers[StudyWeek.Instance().Num].Add(teacher);
             }
             else
             {
                 BadTeachers.Add(StudyWeek.Instance().Num, new List <Teacher>());
                 BadTeachers[StudyWeek.Instance().Num].Add(teacher);
             }
         }
     }
     else
     {
         BadTeachers.Add(StudyWeek.Instance().Num, new List <Teacher>());
     }
 }
Exemplo n.º 3
0
 public static Decanat Instance()
 {
     return(_instance ?? (_instance = new Decanat()));
 }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            List <Teacher> teachers = new List <Teacher>()
            {
                new Teacher("Teach1"),
                new Teacher("Teach2"),
                new Teacher("Teach3")
            };

            foreach (var teacher in teachers)
            {
                StudyWeek.Instance().AddObserver(teacher);
            }

            List <Cathedra> cathedras = new List <Cathedra>()
            {
                new Cathedra("Cth1", new List <Teacher>()
                {
                    teachers[0], teachers[1]
                }),
                new Cathedra("Cth2", new List <Teacher>()
                {
                    teachers[1], teachers[2]
                })
            };

            AchievementState achievementsStats = AchievementState.Instance();

            List <Discipline> disciplines = new List <Discipline>()
            {
                new Discipline("d1", cathedras[0], teachers[0])
                {
                    Groups = new List <string>()
                    {
                        "G1", "G2"
                    }
                },
                new Discipline("d2", cathedras[0], teachers[1])
                {
                    Groups = new List <string>()
                    {
                        "G3", "G2"
                    }
                },
                new Discipline("d3", cathedras[1], teachers[1])
                {
                    Groups = new List <string>()
                    {
                        "G4", "G3"
                    }
                },
                new Discipline("d4", cathedras[1], teachers[2])
                {
                    Groups = new List <string>()
                    {
                        "G1", "G4"
                    }
                }
            };

            achievementsStats.Disciplines.AddRange(disciplines);

            //achievementsStats.AddObserver(Decanat.Instance());
            StudyWeek.Instance().AddObserver(Decanat.Instance());
            foreach (var cathedra in cathedras)
            {
                Decanat.Instance().AddObserver(cathedra);
            }


            StudyWeek.Instance().NewWeek();
            while (!StudyWeek.Instance().IsSession)
            {
                //show info about current week achievements
                Console.WriteLine(achievementsStats.Info(StudyWeek.Instance().Num));
                //show info message for current week for all cathedras
                Console.WriteLine($"Bad teaqchers on {StudyWeek.Instance().Num}th week:");
                foreach (var cathedra in cathedras)
                {
                    Console.WriteLine(cathedra.MesInfo(StudyWeek.Instance().Num));
                }
                Console.WriteLine();

                //new week begin
                StudyWeek.Instance().NewWeek();
            }

            Console.ReadKey();
        }