Курсовая работа: Моделирование систем
procedure TElement.RefuseParcel(SourceIndex: integer);
begin
Sources[SourceIndex].Container.State := psRefused;
TQSheme(Sheme).NewEvent(EV_REFUSE,Self,Sources[SourceIndex],Sources[SourceIndex].Container.Info);
Sources[SourceIndex].DropParcel;
end;
procedure TElement.DropParcel;
begin
Container := nil;
end;
procedure TElement.DoBeforeDrop(Sender : TElement);
begin
if Assigned(FBeforeDrop) then FBeforeDrop(Sender);
end;
procedure TElement.DoAfterDrop(Sender : TElement);
begin
if Assigned(FAfterDrop) then FAfterDrop(Sender);
end;
procedure TElement.DoBeforeTake(Sender : TElement);
begin
if Assigned(FBeforeTake) then FBeforeTake(Sender);
end;
procedure TElement.DoAfterTake(Sender : TElement);
begin
if Assigned(FAfterTake) then FAfterTake(Sender);
end;
constructor TGenerator.Create;
begin
inherited;