Hosted by
|
with Real_Numbers; use Real_Numbers;
with Glyphs; use Glyphs;
with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random;
package Choices is
type Choice(Regular_Size, Special_Size : Natural) is limited private;
type Choice_Access is access Choice;
Default_Regular_Size : constant := 64;
Default_Special_Size : constant := 16;
function Create
(Regular_Size : in Natural := Default_Regular_Size;
Special_Size : in Natural := Default_Special_Size)
return Choice_Access;
procedure Add_Regular
(This : access Choice;
Add : in Glyph_Access);
function Get_Regular
(This : access Choice;
Index : in Positive)
return Glyph_Access;
procedure Add_Special
(This : access Choice;
Add : in Glyph_Access);
function Get_Special
(This : access Choice;
Index : in Positive)
return Glyph_Access;
subtype Percent is Real range 0.0 .. 100.0;
No_Glyphs_To_Choose_From : exception;
function Choose
(This : access Choice;
Special : in Percent)
return Glyph_Access;
private
type Glyph_Array is array(Positive range <>) of Glyph_Access;
type Choice(Regular_Size, Special_Size : Natural) is
limited record
Regular : Glyph_Array(1 .. Regular_Size);
Special : Glyph_Array(1 .. Special_Size);
Regular_Count : Natural := 0;
Special_Count : Natural := 0;
Gen : Generator;
end record;
end Choices;
|