-- This program is the last attempt of artificial intelligency with Ada.
-- Elhoim is Copyright (C) 2023 Manuel ; 
--
--   This program is free software; you can redistribute it and/or modify
--   it under the terms of the GNU General Public License as published by
--   the Free Software Foundation; either version 2 of the License, or
--   (at your option) any later version.
--
--   This program is distributed in the hope that it will be useful,
--   but WITHOUT ANY WARRANTY; without even the implied warranty of
--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--   GNU General Public License for more details.
--
--   You should have received a copy of the GNU General Public License
--   along with this program; if not, write to the Free Software
--   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
--
-- Date := "2023-05-01 20:03:01"
-- Version := "1.0.0a"
with Lib.Engine ;
with Lib.Player ; with Lib.Privat ;

---------------------------------------------------------------------------
--               client->termin->inter->config->center->G consol
--                                      |
-- hander->cyborg->intell->engine  ->	acces server_record
---------------------------------------------------------------------------
--           Neural network (Layer 0 -> Hander
--                          |   \/               cyborg -> Search->Path_Finding
--                         /\   |                intell -> Manual
--           Neural network (layer 1 -> Engine /
--                           |                 /  \
--                          /\               \/     \
--                               [ server ]           Lexic
---------------------------------------------------------------------------
with Lib.Classe ;
with Lib.window ;
------------------------------------------------------
--
--
------------------------------------------------------

with Lib.Search ;

generic
   Glossary_Filename : String;
   Width_Line :Word_Range;
   Max_Words : Lexical_Range;
   Samples_Max : Positive;
   Network_Filename : String;
   Lines  : Line_Range;
   Cols   : Column_Range;
   with package Classes is new Lib.Classe (<>);
   with package Window is new Lib.Window (<>);
package Lib.Server is
   
   
   type Server_Interface_Record is limited private;   
   
   type Server_Interface_Access is access Server_Interface_Record;
   
   type Server_Record;
   
   task type Server_Process (The_Server : access Server_Record) is
      entry Initialize;
      entry Halt(End_Of_Program : out Boolean);
   end Server_Process;
   package Engine is new Lib.Engine (Glossary_Filename, Width_Line, Max_Words, Samples_Max, Network_Filename, Lines,  Cols, Classes, 
				     
				     window);
   
   
   type Server_Record is new Engine.Engine_Record with 
      record
	 Server_Proc : Server_Process (Server_Record ' access);
	 Server_Int  : Server_Interface_Access;
      end record;
   
   type Server_Access is access all Server_Record;
   
   
private
   
   task type Server_Interface_Process(Int : access Server_Interface_Record) is
      entry Init;
      entry Halt;
   end Server_Interface_Process;
   
   type Server_Interface_Record is tagged limited
      record
	 Server_Int_Proc : Server_Interface_Process (Server_Interface_Record ' access);
      end record;
   
end Lib.Server ;