⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 orderevent.h

📁 数据结构
💻 H
字号:
#ifndef _orderEvent
#define _orderEvent

#include"event.h"
#include"leaveEvent.h"
#include"customerGroup.h"
#include"storeSimulation.h"
#include"random.h"

#include<iostream.h>
#include<assert.h>


class orderEvent:public event
{
 public:
	 orderEvent(unsigned int,customerGroup*);
	 virtual void processEvent();
 private:
	 customerGroup* group;
};


orderEvent ::orderEvent(unsigned int time1,customerGroup* gup): event(time1),group(gup)
{
}


void orderEvent::processEvent()//点单
{
	int hours,minuters;
	hours=time/60+8;
	minuters=time%60;		

    int scoops=group->orderSize();
    cout<<hours<<"点"<<minuters<<"分钟"<<"    "<<"有"<<group->groupsize<<"人点了"<<scoops<<"个冰淇淋."<<endl;
    store.order(scoops);
    event*le=new leaveEvent(time+randgen.between(15,35),group);
    assert(le!=0);
    store.scheduleEvent(le);
}

#endif   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -