Exemplo n.º 1
0
void Elevator::HandleStopBeep(Environment &env, const Event &e) {

	if (ForMe(e)) {
		if (beeping_ != 0) {
			env.CancelEvent(beeping_);
			beeping_ = 0;
		} else
			env.SendEvent("Elevator::Beeped", 0, this);
	}
}
Exemplo n.º 2
0
void Person::HandleBeeping(Environment &env, const Event &e) {

	Elevator *ele = static_cast<Elevator*>(e.GetSender());

	if (elevator_ == ele && elevator_) {

		beeping_ = true;
		env.CancelEvent(action_); // Cancel Interface::Interact
		Exit(env);
	}
}
Exemplo n.º 3
0
void Person::Cancel(Environment &env) {

	if (action_) {

		env.CancelEvent(action_);
		env.SendEvent("Person::Canceled", 0, this);

		action_ = 0;

		isEnteringOrExiting_ = false;
	}
}