Курсовая работа: Моделирование систем
end;
function TElement.GetSourceCount: integer;
begin
Result := FSources.Count;
end;
function TElement.GetSource(Index: integer): TElement;
begin
Result := FSources[Index];
end;
procedure TElement.TakeParcel(SourceIndex : integer);
begin
FContainer := Sources[SourceIndex].FContainer;
TQSheme(Sheme).NewEvent(EV_TAKE,Self,Sources[SourceIndex],FContainer.Info);
Sources[SourceIndex].DropParcel;
end;
procedure TElement.Pass(SourceIndex: integer);
var Source : TElement;
begin
if SourceIndex <> -1 then Source := Sources[SourceIndex];
DoBeforeTake(Self);
if SourceIndex <> -1 then Source.DoBeforeDrop(Source);
TakeParcel(SourceIndex);
DoAfterTake(Self);
if SourceIndex <> -1 then Source.DoAfterDrop(Source);
end;
function TElement.GetCanDropParcelFor(Destination: TElement): Boolean;
begin
Result := CanDrop;
if Assigned(OnDestinationValidate) then