with Events;
with Keyboard; use Keyboard;
with Tools; use Tools;
pragma Elaborate_All( Events );
package Events.Ked is
APPLY_TOOL_MAP_ID : constant Event_Id := To_Event_Id( "Apply_Tool_Map" );
IMPORT_WORLD_ID : constant Event_Id := To_Event_Id( "Import_World" );
SAVE_WORLD_ID : constant Event_Id := To_Event_Id( "Save_World" );
SET_TOOL_ID : constant Event_Id := To_Event_Id( "Set_Tool" );
type Apply_Tool_Map_Event is new Event with private;
type A_Apply_Tool_Map_Event is access all Apply_Tool_Map_Event'Class;
function Get_Function( this : not null access Apply_Tool_Map_Event'Class ) return Function_Type;
function Get_Layer( this : not null access Apply_Tool_Map_Event'Class ) return Integer;
function Get_Modifiers( this : not null access Apply_Tool_Map_Event'Class ) return Modifiers_Array;
function Get_X( this : not null access Apply_Tool_Map_Event'Class ) return Integer;
function Get_Y( this : not null access Apply_Tool_Map_Event'Class ) return Integer;
function Is_First( this : not null access Apply_Tool_Map_Event'Class ) return Boolean;
type Import_World_Event is new Event with private;
type A_Import_World_Event is access all Import_World_Event'Class;
function Get_Domain( this : not null access Import_World_Event'Class ) return String;
pragma Postcondition( Get_Domain'Result'Length > 0 );
function Get_Filename( this : not null access Import_World_Event'Class ) return String;
pragma Postcondition( Get_Filename'Result'Length > 0 );
function Get_Library_Name( this : not null access Import_World_Event'Class ) return String;
pragma Postcondition( Get_Library_Name'Result'Length > 0 );
function Get_Tolerance( this : not null access Import_World_Event'Class ) return Natural;
type Save_World_Event is new Event with private;
type A_Save_World_Event is access all Save_World_Event'Class;
function Get_Filename( this : not null access Save_World_Event'Class ) return String;
pragma Postcondition( Get_Filename'Result'Length > 0 );
type Set_Tool_Event is new Event with private;
type A_Set_Tool_Event is access all Set_Tool_Event'Class;
function Get_Tool( this : not null access Set_Tool_Event'Class ) return A_Tool;
procedure Queue_Apply_Tool_Map( func : Function_Type;
modifiers : Modifiers_Array;
first : Boolean;
x, y : Integer;
layer : Integer );
procedure Trigger_Import_World( filename : String;
libName : String;
domain : String;
tolerance : Natural );
pragma Precondition( filename'Length > 0 );
pragma Precondition( libName'Length > 0 );
pragma Precondition( domain'Length > 0 );
procedure Trigger_Save_World( filename : String );
pragma Postcondition( filename'Length > 0 );
procedure Queue_Set_Tool( tool : not null A_Tool );
private
type Apply_Tool_Map_Event is new Event with
record
func : Function_Type := Primary;
modifiers : Modifiers_Array := Modifiers_Array'(others=>False);
first : Boolean := False;
x, y,
layer : Integer := 0;
end record;
procedure Construct( this : access Apply_Tool_Map_Event;
func : Function_Type;
modifiers : Modifiers_Array;
first : Boolean;
x, y : Integer;
layer : Integer );
type Import_World_Event is new Event with
record
filename : Unbounded_String;
libName : Unbounded_String;
domain : Unbounded_String;
tolerance : Natural := 0;
end record;
procedure Construct( this : access Import_World_Event;
filename : String;
libName : String;
domain : String;
tolerance : Natural );
pragma Precondition( filename'Length > 0 );
pragma Precondition( libName'Length > 0 );
pragma Precondition( domain'Length > 0 );
type Save_World_Event is new Event with
record
filename : Unbounded_String;
end record;
procedure Construct( this : access Save_World_Event; filename : String );
pragma Precondition( filename'Length > 0 );
type Set_Tool_Event is new Event with
record
tool : A_Tool := null;
end record;
procedure Adjust( this : access Set_Tool_Event );
procedure Construct( this : access Set_Tool_Event; tool : not null A_Tool );
procedure Delete( this : in out Set_Tool_Event );
end Events.Ked;