private with Tiles;
private with Tiles.Libraries;
package Widgets.Scoreboards is
type Scoreboard is new Widget with private;
type A_Scoreboard is access all Scoreboard'Class;
function Create_Scoreboard( view : not null access Game_Views.Game_View'Class;
id : String;
libName : String ) return A_Scoreboard;
pragma Precondition( id'Length > 0 );
pragma Precondition( libName'Length > 0 );
pragma Postcondition( Create_Scoreboard'Result /= null );
procedure Set_Ammo( this : access Scoreboard; ammo : Natural );
procedure Set_Lives( this : access Scoreboard; lives : Natural );
procedure Set_Points( this : access Scoreboard; points : Natural );
private
use Tiles;
use Tiles.Libraries;
type Scoreboard is new Widget with
record
lib : A_Tile_Library := null;
backgroundId : Natural := 0;
digitId : Tile_Id_Array(0..9) := (others => 0);
ammo : Integer := 0;
lives : Integer := 0;
points : Integer := 0;
end record;
procedure Construct( this : access Scoreboard;
view : not null access Game_Views.Game_View'Class;
id : String;
libName : String );
pragma Precondition( id'Length > 0 );
pragma Precondition( libName'Length > 0 );
procedure Delete( this : in out Scoreboard );
procedure Draw_Content( this : access Scoreboard; dc : Drawing_Context );
function Get_Min_Height( this : access Scoreboard ) return Natural;
function Get_Min_Width( this : access Scoreboard ) return Natural;
end Widgets.Scoreboards;