Beispiel #1
0
        public void StartSim(FormSimulationScreen fss)
        {
            this.fss = fss;
            hall1.ConfigHall();
            seatList2 = hall1.Seats();
            doors     = hall1.Doors();
            amount    = Convert.ToInt32(customerCount * seatList2.GetLength(1) * seatList2.GetLength(0));
            AssignCustomers(amount);
            AssignCustSeats();

            for (int i = 0; i < hall1.GetRow(); i++)
            {
                for (int j = 0; j < hall1.GetColumn(); j++)
                {
                    System.Windows.Forms.Panel p = new System.Windows.Forms.Panel();
                    p.Location  = new System.Drawing.Point(seatList2[i, j].PosX, seatList2[i, j].PosY);
                    p.Size      = new System.Drawing.Size(seatList2[i, j].SHeight, seatList2[i, j].SWidth);
                    p.BackColor = seatList2[i, j].SeatColor;

                    //System.Windows.Forms.Label l = new System.Windows.Forms.Label();
                    //l.Text = seatList2[i, j].SeatId;
                    //l.Font = new System.Drawing.Font("Arial", 4);
                    //l.TextAlign = System.Drawing.ContentAlignment.TopLeft;
#if DEBUG
                    p.Controls.Add(addlabel("Seats", i, j));
#endif
                    //Console.WriteLine(seatList2[i, j]);
                    fss.Controls.Add(p);
                }
            }

            for (int i = 0; i < hall1.GetDoorAmount(); i++)
            {
                System.Windows.Forms.Panel p = new System.Windows.Forms.Panel();
                p.Location  = new System.Drawing.Point(doors[i].PosX, doors[i].PosY);
                p.Size      = new System.Drawing.Size(doors[i].DWidth, doors[i].DHeight);
                p.BackColor = System.Drawing.Color.Purple;
                fss.Controls.Add(p);
            }
            GenerateCust();
        }