Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
fpc-src / usr / share / fpcsrc / 3.0.0 / tests / webtbs / tw14403.pp
Size: Mime:
{$R+}
{$mode objfpc}

type
  TDummyShapeTree = class
    function ShapesCount(const OnlyActive, OnlyVisible, OnlyCollidable: boolean): Cardinal; virtual; abstract;
  end;

  TDummyShapeTreeGroup = class(TDummyShapeTree)
  public
    Child: TDummyShapeTree;

    function ShapesCount(const OnlyActive, OnlyVisible, OnlyCollidable: boolean): Cardinal; override;
  end;

  TDummyShape = class(TDummyShapeTree)
  public
    function ShapesCount(const OnlyActive, OnlyVisible, OnlyCollidable: boolean): Cardinal; override;
  end;

function TDummyShape.ShapesCount(
  const OnlyActive, OnlyVisible, OnlyCollidable: boolean): Cardinal;
begin
  Result := 1;
end;

function TDummyShapeTreeGroup.ShapesCount(
  const OnlyActive, OnlyVisible, OnlyCollidable: boolean): Cardinal;
var
  I: Integer;
  Something: Cardinal;
begin
  Result := 0;
  for I := 0 to 1 do
  begin
    Result := Result + Child.ShapesCount(OnlyActive, OnlyVisible, OnlyCollidable);
  end;
end;

var
  G: TDummyShapeTreeGroup;
begin
  G := TDummyShapeTreeGroup.Create;
  G.Child := TDummyShape.Create;
  Writeln(G.ShapesCount(true, true, false));
  G.Free;
end.