unit OrgInterface;

interface

uses
  Graphics;

const
  MaxURCount = 256;   // new in M2
  InvalidUR = MaxInt; // new in M2

type
  TMoveDirection = (N, W, S, E);

  TOptions = record // new in M2
    FuzzyAttack: Boolean;
    EnergyPerStep: Integer;
    DistributeEnergy: Boolean;
    ChemGoAway: Boolean;
  end;

  IVLFOrganism = interface
    function Mass: Byte; stdcall;
    function FoodIn: Byte; stdcall;
    function Energy: Byte; stdcall;
    function X: Integer; stdcall;
    function Y: Integer; stdcall;
    function MaxY: Integer; stdcall;
    function MaxX: Integer; stdcall;
    function Color: TColor; stdcall;
    function Species: PChar; stdcall;
    function Age: Integer; stdcall;
    function MaxAge: Integer; stdcall;
    function GenCount: Integer; stdcall;
    function UR(index: Byte): Integer; stdcall;
    function MinX: Integer; stdcall;                      // new in M2
    function MinY: Integer; stdcall;                      // new in M2
    function MaxMoveDist: Integer; stdcall;               // new in M2
    function AllocedURCount: Integer; stdcall;            // new in M2
    procedure GetOptions(var Options: TOptions); stdcall; // new in M2
    function ForeignUR(index: Byte): Integer; stdcall;    // new in M2
    function ForeignAllocedURCount: Integer; stdcall;     // new in M2

    function Eat(Value: Byte): Byte; stdcall;             // changed in M2
    function Build(Value: Byte): Byte; stdcall;           // changed in M2
    function Digest(Value: Byte): Byte; stdcall;          // changed in M2
    function Move(Direction: TMoveDirection; Distance: Integer): Integer; stdcall; // changed in M2
    function Spread(Value: Byte): Byte; stdcall;          // changed in M2
    function Secrete(Value: Byte): Byte; stdcall;         // changed in M2
    procedure DivCell; stdcall;
    function Attack: Boolean; stdcall;                    // changed in M2
    procedure Die; stdcall;
    function FoodAt(AX, AY: Integer): Byte; stdcall;
    function OrgAt(AX, AY: Integer): PChar; stdcall;
    function SetUR(index: Byte; Value: Integer): Boolean; stdcall;        // changed in M2
    function SetForeignUR(index: Byte; Value: Integer): Boolean; stdcall; // changed in M2
    procedure SetColor(R, G, B: Byte); stdcall;
    function Exclude(Radius: Integer; Value: Byte): Integer; stdcall;     // changed in M2
    function ChemAt(AX, AY: Integer): Byte; stdcall;
    function AllocUR(Count: Integer): Integer; stdcall;                   // new in M2
  end;

function OrgRequiredVersion: Integer; stdcall;

implementation

function OrgRequiredVersion: Integer;
begin
  Result := $00040000;
end;

end.
