with Events;
with Maps; use Maps;
pragma Elaborate_All( Events );
package Events.World is
type Create_World_Event is new Event with private;
type A_Create_World_Event is access all Create_World_Event'Class;
CREATE_WORLD_ID : constant Event_Id := To_Event_Id( "Create_World" );
function Get_Domain( this : not null access Create_World_Event'Class ) return String;
pragma Postcondition( Get_Domain'Result'Length > 0 );
function Get_Height( this : not null access Create_World_Event'Class ) return Positive;
function Get_Library_Name( this : not null access Create_World_Event'Class ) return String;
pragma Postcondition( Get_Library_Name'Result'Length > 0 );
function Get_Width( this : not null access Create_World_Event'Class ) return Positive;
type Load_World_Event is new Event with private;
type A_Load_World_Event is access all Load_World_Event'Class;
LOAD_WORLD_ID : constant Event_Id := To_Event_Id( "Load_World" );
function Get_Filename( this : not null access Load_World_Event'Class ) return String;
pragma Postcondition( Get_Filename'Result'Length > 0 );
type New_World_Event is new Event with private;
type A_New_World_Event is access all New_World_Event'Class;
NEW_WORLD_ID : constant Event_Id := To_Event_Id( "New_World" );
function Get_Height( this : not null access New_World_Event'Class ) return Positive;
function Get_Layers( this : not null access New_World_Event'Class ) return A_Layer_Array;
pragma Postcondition( Get_Layers'Result /= null );
function Get_Library_Name( this : not null access New_World_Event'Class ) return String;
pragma Postcondition( Get_Library_Name'Result'Length > 0 );
function Get_Tile_Width( this : not null access New_World_Event'Class ) return Positive;
function Get_Width( this : not null access New_World_Event'Class ) return Positive;
type Resize_World_Event is new Event with private;
type A_Resize_World_Event is access all Resize_World_Event'Class;
RESIZE_WORLD_ID : constant Event_Id := To_Event_Id( "Resize_World" );
function Get_Height( this : not null access Resize_World_Event'Class ) return Positive;
function Get_Width( this : not null access Resize_World_Event'Class ) return Positive;
type Set_World_Property_Event is new Event with private;
type A_Set_World_Property_Event is access all Set_World_Property_Event'Class;
SET_WORLD_PROPERTY_ID : constant Event_Id := To_Event_Id( "Set_World_Property" );
function Get_Property_Name( this : not null access Set_World_Property_Event'Class ) return String;
pragma Postcondition( Get_Property_Name'Result'Length > 0 );
function Get_Value( this : not null access Set_World_Property_Event'Class ) return String;
type Tile_Changed_Event is new Event with private;
type A_Tile_Changed_Event is access all Tile_Changed_Event'Class;
TILE_CHANGED_ID : constant Event_Id := To_Event_Id( "Tile_Changed" );
function Get_Layer( this : not null access Tile_Changed_Event'Class ) return Integer;
function Get_Tile_ID( this : not null access Tile_Changed_Event'Class ) return Natural;
function Get_X( this : not null access Tile_Changed_Event'Class ) return Natural;
function Get_Y( this : not null access Tile_Changed_Event'Class ) return Natural;
type World_Modified_Event is new Event with private;
type A_World_Modified_Event is access all World_Modified_Event'Class;
WORLD_MODIFIED_ID : constant Event_Id := To_Event_Id( "World_Modified" );
type World_Property_Changed_Event is new Event with private;
type A_World_Property_Changed_Event is access all World_Property_Changed_Event'Class;
WORLD_PROPERTY_CHANGED_ID : constant Event_Id := To_Event_Id( "World_Property_Changed" );
function Get_Property_Name( this : not null access World_Property_Changed_Event'Class ) return String;
pragma Postcondition( Get_Property_Name'Result'Length > 0 );
function Get_Value( this : not null access World_Property_Changed_Event'Class ) return String;
procedure Trigger_Create_World( width,
height : Positive;
libName,
domain : String );
pragma Precondition( libName'Length > 0 );
pragma Precondition( domain'Length > 0 );
procedure Queue_Load_World( filename : String );
pragma Precondition( filename'Length > 0 );
procedure Trigger_Load_World( filename : String );
pragma Precondition( filename'Length > 0 );
procedure Queue_New_World( width,
height,
tileWidth : Positive;
layers : not null A_Layer_Array;
libName : String );
pragma Precondition( libName'Length > 0 );
procedure Trigger_Resize_World( width, height : Positive );
procedure Queue_Set_World_Property( name, value : String );
pragma Precondition( name'Length > 0 );
procedure Queue_Tile_Changed( layer : Integer;
x, y : Natural;
tile_id : Natural );
procedure Queue_World_Modified;
procedure Queue_World_Property_Changed( name, value : String );
pragma Precondition( name'Length > 0 );
private
type Create_World_Event is new Event with
record
width,
height : Positive := 1;
libName : Unbounded_String;
domain : Unbounded_String;
end record;
procedure Construct( this : access Create_World_Event;
width,
height : Positive;
libName,
domain : String );
pragma Precondition( libName'Length > 0 );
pragma Precondition( domain'Length > 0 );
type Load_World_Event is new Event with
record
filename : Unbounded_String;
end record;
procedure Construct( this : access Load_World_Event; filename : String );
pragma Precondition( filename'Length > 0 );
type New_World_Event is new Event with
record
width,
height,
tileWidth : Positive := 1;
layers : A_Layer_Array := null;
libName : Unbounded_String;
end record;
procedure Adjust( this : access New_World_Event );
procedure Construct( this : access New_World_Event;
width,
height,
tileWidth : Positive;
layers : not null A_Layer_Array;
libName : String );
pragma Precondition( libName'Length > 0 );
procedure Delete( this : in out New_World_Event );
type Resize_World_Event is new Event with
record
width,
height : Positive := 1;
end record;
procedure Construct( this : access Resize_World_Event;
width,
height : Positive );
type Set_World_Property_Event is new Event with
record
name,
value : Unbounded_String;
end record;
procedure Construct( this : access Set_World_Property_Event;
name,
value : String );
pragma Precondition( name'Length > 0 );
type Tile_Changed_Event is new Event with
record
layer : Integer := 0;
x, y : Natural := 0;
tile_id : Natural := 0;
end record;
procedure Construct( this : access Tile_Changed_Event;
layer : Integer;
x, y : Natural;
tile_id : Natural );
type World_Modified_Event is new Event with null record;
type World_Property_Changed_Event is new Event with
record
name,
value : Unbounded_String;
end record;
procedure Construct( this : access World_Property_Changed_Event;
name,
value : String );
pragma Precondition( name'Length > 0 );
end Events.World;