1. private with Tiles; 
  2. private with Tiles.Libraries; 
  3.  
  4. package Widgets.Scoreboards is 
  5.  
  6.     type Scoreboard is new Widget with private; 
  7.     type A_Scoreboard is access all Scoreboard'Class; 
  8.  
  9.     function Create_Scoreboard( view    : not null access Game_Views.Game_View'Class; 
  10.                                 id      : String; 
  11.                                 libName : String ) return A_Scoreboard; 
  12.     pragma Precondition( id'Length > 0 ); 
  13.     pragma Precondition( libName'Length > 0 ); 
  14.     pragma Postcondition( Create_Scoreboard'Result /= null ); 
  15.  
  16.     procedure Set_Ammo( this : access Scoreboard; ammo : Natural ); 
  17.  
  18.     procedure Set_Lives( this : access Scoreboard; lives : Natural ); 
  19.  
  20.     procedure Set_Points( this : access Scoreboard; points : Natural ); 
  21.  
  22. private 
  23.  
  24.     use Tiles; 
  25.     use Tiles.Libraries; 
  26.  
  27.     type Scoreboard is new Widget with 
  28.         record 
  29.             lib          : A_Tile_Library := null;    -- may be null if library cant load 
  30.             backgroundId : Natural := 0;              -- id of background tile 
  31.             digitId      : Tile_Id_Array(0..9) := (others => 0); 
  32.             ammo         : Integer := 0; 
  33.             lives        : Integer := 0; 
  34.             points       : Integer := 0; 
  35.         end record; 
  36.  
  37.     procedure Construct( this    : access Scoreboard; 
  38.                          view    : not null access Game_Views.Game_View'Class; 
  39.                          id      : String; 
  40.                          libName : String ); 
  41.     pragma Precondition( id'Length > 0 ); 
  42.     pragma Precondition( libName'Length > 0 ); 
  43.  
  44.     procedure Delete( this : in out Scoreboard ); 
  45.  
  46.     procedure Draw_Content( this : access Scoreboard; dc : Drawing_Context ); 
  47.  
  48.     function Get_Min_Height( this : access Scoreboard ) return Natural; 
  49.  
  50.     function Get_Min_Width( this : access Scoreboard ) return Natural; 
  51.  
  52. end Widgets.Scoreboards;