Esempio n. 1
0
        static private void MenLogic(ref ObjectBufer render, bool is60fps)
        {
            if (render.MenBuffer.Count > 0)
            {
                foreach (var men in render.MenBuffer)
                {
                    if (is60fps)
                    {
                        men.Move(20, 0);
                    }
                    else
                    {
                        men.Move64(20, 0);
                    }

                    if (men.label.Location.X >= 1280 / 2 - 100 && !men.IsCanGo && men.WithDoc)
                    {
                        men.withDocSwitch();
                        render.ActivObjBuffer.Add(men.GetBook());
                    }

                    if (men.label.Location.X >= 1280 - 100)
                    {
                        Men m = Men.GeneratRandomMen();
                        render.MenBuffer.Add(m);
                        render.ActivObjBuffer.Add(m.GetBook());
                        render.MenBuffer.Remove(men);
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
        public void SetMenBuffer()
        {
            var BaseBook = new Book(Color.Green, new Point(500, form.ClientSize.Height / 2 + 101), new Size(100, 50), " ");

            BaseBook.label.Text =
                @"студак УрФУ РТФ";
            BaseBook.id = 0;

            Men men = new Men(Color.Green,
                              new Point(0, 720 / 4),
                              new Size(300, 500),
                              BaseBook,
                              false);

            men.id = 0;

            render.AddMen(men);
        }
Esempio n. 3
0
        static public Men GeneratRandomMen()
        {
            Color c    = Color.Red;
            Point pos  = new Point(0, 720 / 4);
            Size  size = new Size(300, 500);

            var r = new Random();

            int  id = r.Next();
            bool f  = id % 2 == 0;

            Book book = RandomBook(id, f);

            var men = new Men(c, pos, size, book, false);

            men.id = f ? book.id : 0;

            return(men);
        }
Esempio n. 4
0
 public void RemoveMen(Men men)
 {
     MenBuffer.Remove(men);
 }
Esempio n. 5
0
 public void AddMen(Men men)
 {
     MenBuffer.Add(men);
 }