-
Notifications
You must be signed in to change notification settings - Fork 0
/
groupoff.cc
35 lines (32 loc) · 1.12 KB
/
groupoff.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "groupoff.h"
#include <iostream>
using namespace std;
void Groupoff::main() {
prt.print( Printer::Kind::Groupoff, 'S' );
for( ;;) {
_Accept( ~Groupoff ) {
prt.print( Printer::Kind::Groupoff, 'F' );
delete []giftCardList;
return;
} _Else {
_When (cur < numStudents) _Accept ( giftCard ) {
yield( groupoffDelay );
WATCard *card = new WATCard();
card->deposit( sodaCost );
curCard.delivery( card ) ;
prt.print( Printer::Kind::Groupoff, 'D', sodaCost );
}
}
}
}
Groupoff::Groupoff( Printer & prt, unsigned int numStudents, unsigned int sodaCost, unsigned int groupoffDelay ):
prt( prt ), numStudents( numStudents ), sodaCost( sodaCost ), groupoffDelay( groupoffDelay ) {
// giftCardList = new WATCard::FWATCard[numStudents];
// for ( unsigned int g =0; g < numStudents; g++ ) {
// giftCardList[g] = WATCard::FWATCard();
// }
}
WATCard::FWATCard Groupoff::giftCard() {
curCard = WATCard::FWATCard();
return curCard;
}