Exemplo n.º 1
0
        public Customer(int customerID, int customerAmount, Hall hall1, ref Random r)
        {
            this.customerID     = customerID;
            this.customerAmount = customerAmount;
            List <Customer> customers = new List <Customer>();

            this.HungaryRandomness = r.Next(0, 10);

            if (HungaryRandomness > 5)
            {
                this.hungry = true;
            }
            else
            {
                this.hungry = false;
            }

            Console.WriteLine($"Number: {HungaryRandomness} hungry:{this.hungry}");

            hall = hall1;
            hall.HallConfiguration();
            seats = hall.Seats();
            doors = hall.Doors();
            shops = hall.Shops();

            seatRowCustomers    = seats.GetLength(0);
            seatColumnCustomers = seats.GetLength(1);
            shopCustomers       = shops.GetLength(0);
        }
Exemplo n.º 2
0
        public void StartSim(SimulatingScreen FormScreen)
        {
            this.FormScreen = FormScreen;
            hall1.HallConfiguration();
            listSeats = hall1.Seats();
            doors     = hall1.Doors();
            shops     = hall1.Shops();

            GenratedCustomers(amount);
            AssignCustomerSeats();

            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(listSeats[i, j].seatPositionX, listSeats[i, j].seatPositionY);
                    p.Size      = new System.Drawing.Size(listSeats[i, j].SHeight, listSeats[i, j].SWidth);
                    p.BackColor = listSeats[i, j].seatColour;

                    FormScreen.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].DoorPositionX, doors[i].DoorPositionY);
                p.Size      = new System.Drawing.Size(doors[i].DoorWidth, doors[i].DoorHeight);
                p.BackColor = System.Drawing.Color.Tomato;
                FormScreen.Controls.Add(p);
            }
            for (int i = 0; i < hall1.GetShopsAmount(); i++)
            {
                System.Windows.Forms.Panel p = new System.Windows.Forms.Panel();
                p.Location  = new System.Drawing.Point(shops[i].shopsPositionX, shops[i].shopsPositionY);
                p.Size      = new System.Drawing.Size(shops[i].shopsWidth, shops[i].shopsHeight);
                p.BackColor = System.Drawing.Color.BlueViolet;
                FormScreen.Controls.Add(p);
            }
            generateCustomer();
        }