http://www.adaconcept.com/programs/ontozorendszeres_szimulacio/szimulacio-vezerles.adb
with Ada.Text_IO;

with Szimulacio.Ontozorendszer.Elemek.Vizforras;

with Szimulacio.Ontozorendszer.Megjelenito.Muveletek;

package body Szimulacio.Vezerles is

   package Elemek renames Szimulacio.Ontozorendszer.Elemek;
   package Megjelenito_Muveletek renames Szimulacio.Ontozorendszer.Megjelenito.Muveletek;


   Utem : constant Duration := 1.5;

   function A_Szimulacio_Uteme return Duration is
   begin
      return Utem;
   end A_Szimulacio_Uteme;


   Vege : Boolean := False;

   function Vege_A_Szimulacionak return Boolean is
   begin
      return Vege;
   end Vege_A_Szimulacionak;


   procedure Inditas is
      Ch : Character;
      Van_Leutott_Karakter : Boolean;
   begin
      Ada.Text_IO.Put_Line("A szimulacio indul");

      Elemek.Letrehozas;

      Elemek.Inicializalas;

      while not Vege loop

         Elemek.Frissites;

         Ada.Text_IO.Get_Immediate(Ch, Van_Leutott_Karakter);

         if Van_Leutott_Karakter and then (Ch = 'v' or Ch = 'V') then
            if Elemek.Vizforras.Vizet_Ad then
               Elemek.Vizforras.Kikapcsol;
            else
               Elemek.Vizforras.Bekapcsol;
            end if;
         end if;

         if Van_Leutott_Karakter and then (Ch = 'x' or Ch = 'X') then     --| Arrol, hogy minden Ontozorendszer-Elem ertesuljon
            Vege := True;                                                 --| a szimulacio leallitasarol, most nem gondoskodunk!!!
         end if;                                                          --|

         Megjelenito_Muveletek.Megjelenit;

         delay Utem;                                                      -- itt kellene hasznalni a korabban bemutatott idozitot
      end loop;

   end Inditas;


end Szimulacio.Vezerles;