Пример: Глобальная сеть INTERNET
Я ищу:
На главную  |  Добавить в избранное  

Главная/

Программирование, базы данных. /

Программа эмуляции развития популяций животных

Документ 1 | Документ 2 | Документ 3 | Документ 4

{Init object}

unit fauna1;

 interface

  uses graph;

{}

  Type TPosition=object

   x,y : integer;

   procedure Init(x0,y0 : integer);

   function getx : integer;

   function gety : integer;

  end;

{}

  type Tosob=object(TPosition)

   color : word;

   vidno : boolean;

   AGE : INTEGER;

   constructor Init(x0,y0,age0:integer;col:word);

   destructor Done ; virtual ;

    procedure Show ; virtual ;

    procedure Blind ; virtual ;

    function Daizwet : word;

    function VidnoLi : boolean;

    FUNCTION DAIAGE : INTEGER;

  end;

  Posob=^Tosob;

{}

 

{Crea Object}

{metod Tposition}

Implementation

 Procedure Tposition.Init(x0,y0:integer);

  Begin

   x:=x0;

   y:=y0;

  End;

 Function Tposition.Getx:integer;

  Begin GetX:=x End;

 Function Tposition.Gety:integer;

  Begin Gety:=y End;

{}

 Constructor Tosob.Init(x0,y0,age0:integer;col:word);

  Begin

   Tposition.Init(x0,y0);

   AGE:=AGE0;

   color:=col;

   vidno:=false;

  End;

 Destructor Tosob.Done;

  Begin

   Tosob.blind;

  End;

 procedure Tosob.Show;

  Begin

   putpixel(TPosition.GetX, TPosition.GetY,color);

   vidno:=True;

  End;

 procedure Tosob.Blind;

  Begin

   putpixel(TPosition.GetX, TPosition.GetY,GetBKColor);

   vidno:=False;

  End;

 Function Tosob.Daizwet : word;

  Begin Daizwet:=color End;

 Function Tosob.VidnoLi : Boolean;

  Begin VidnoLi:=Vidno End;

 FUNCTION TOSOB.DAIAGE:INTEGER;

  BEGIN DAIAGE:=AGE END;

End.


Copyright © 2005—2007 «RefStore.Ru»