Index

Package: Keen

Description

package Events.Keen is
Copyright (c) 2012 Kevin Wellwood All rights reserved. This source code is distributed under the Modified BSD License. For terms and conditions, see license.txt.

Classes

Dialog_Desc

type Dialog_Desc is new Object with private;

Ancestors:

Primitive operations:

Adjust (overriding Objects.Adjust)
Construct
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)
Objects.To_String (Inherited)

Dialog_Event

type Dialog_Event is new Event with private;

Ancestors:

Primitive operations:

Adjust (overriding Objects.Adjust)
Construct
Delete (overriding Objects.Delete)
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Construct (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)

Dialog_Response_Event

type Dialog_Response_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)

Give_Ammo_Event

type Give_Ammo_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)

Give_Drops_Event

type Give_Drops_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)

Give_Points_Event

type Give_Points_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)

Message_Event

type Message_Event is new Event with private;

Ancestors:

Primitive operations:

Construct
Events.Construct (Inherited)
Events.To_String (Inherited)
Objects.Adjust (Inherited)
Objects.Construct (Inherited)
Objects.Delete (Inherited)
Objects.Object_Read (Inherited)
Objects.Object_Write (Inherited)

Types

A_Dialog_Desc

type A_Dialog_Desc is access all Dialog_Desc'Class;

A_Dialog_Event

type A_Dialog_Event is access all Dialog_Event'Class;

A_Dialog_Response_Event

type A_Dialog_Response_Event is access all Dialog_Response_Event'Class;

A_Give_Ammo_Event

type A_Give_Ammo_Event is access all Give_Ammo_Event'Class;

A_Give_Drops_Event

type A_Give_Drops_Event is access all Give_Drops_Event'Class;

A_Give_Points_Event

type A_Give_Points_Event is access all Give_Points_Event'Class;

A_Message_Event

type A_Message_Event is access all Message_Event'Class;

Constants & Global variables

DIALOG_ID (Events.Event_Id)

DIALOG_ID : constant Event_Id := To_Event_Id( "Dialog" );

DIALOG_RESPONSE_ID (Events.Event_Id)

DIALOG_RESPONSE_ID : constant Event_Id := To_Event_Id( "Dialog_Response" );

GIVE_AMMO_ID (Events.Event_Id)

GIVE_AMMO_ID : constant Event_Id := To_Event_Id( "Give_Ammo" );

GIVE_DROPS_ID (Events.Event_Id)

GIVE_DROPS_ID : constant Event_Id := To_Event_Id( "Give_Drops" );

GIVE_POINTS_ID (Events.Event_Id)

GIVE_POINTS_ID : constant Event_Id := To_Event_Id( "Give_Points" );

MESSAGE_ID (Events.Event_Id)

MESSAGE_ID : constant Event_Id := To_Event_Id( "Message" );

Subprograms & Entries

Create_Dialog_Desc

function Create_Dialog_Desc
( name: String;
text: String ) return A_Dialog_Desc;
Creates a dialog description for a dialog event. There isn't an exposed delete procedure because these are meant to be passed to Queue_Dialog.

Add_Choice

procedure Add_Choice
( this: not null access Dialog_Desc'Class;
text: String );
Adds a new choice to the description, at the end of the list.

Get_Choices

function Get_Choices
( this: not null access Dialog_Desc'Class ) return Natural;
Returns the number of choices added to the description.

Get_Choice

function Get_Choice
( this: not null access Dialog_Desc'Class;
choice: Positive ) return String;
Returns an empty string if 'choice' doesn't exist.

Get_Name

function Get_Name
( this: not null access Dialog_Desc'Class ) return String;
Returns the dialog's name.

Get_Text

function Get_Text
( this: not null access Dialog_Desc'Class ) return String;
Returns the dialog's text.

Get_Desc

function Get_Desc
( this: not null access Dialog_Event'Class ) return A_Dialog_Desc;
Returns a reference to the event's Dialog_Desc object. It belongs to the event; do not modify it.

Get_Dialog_Id

function Get_Dialog_Id
( this: not null access Dialog_Event'Class ) return Integer;
Returns the id the dialog was given when it was queued. Any response to the dialog should have this id.

Get_Choice

function Get_Choice
( this: not null access Dialog_Response_Event'Class ) return Positive;
Returns the ordinal choice of the dialog's response.

Get_Dialog_Id

function Get_Dialog_Id
( this: not null access Dialog_Response_Event'Class ) return Integer;
Returns the id of the dialog to which response belongs.

Get_Amount

function Get_Amount
( this: not null access Give_Ammo_Event'Class ) return Integer;

Get_Amount

function Get_Amount
( this: not null access Give_Drops_Event'Class ) return Integer;

Get_Amount

function Get_Amount
( this: not null access Give_Points_Event'Class ) return Integer;

Get_Icon

function Get_Icon
( this: not null access Message_Event'Class ) return String;

Get_Text

function Get_Text
( this: not null access Message_Event'Class ) return String;

Get_Text_Align

function Get_Text_Align
( this: not null access Message_Event'Class ) return Align_Type;

Queue_Dialog

procedure Queue_Dialog
( dialogId: Integer;
description: in out A_Dialog_Desc );
'dialogId' should be a unique number to identify the Dialog_Response_Event that will be sent in response. 'description' will be consumed.

Queue_Dialog_Response

procedure Queue_Dialog_Response
( dialogId: Integer;
choice: Positive );

Queue_Give_Ammo

procedure Queue_Give_Ammo
( amount: Integer );

Queue_Give_Drops

procedure Queue_Give_Drops
( amount: Integer );

Queue_Give_Points

procedure Queue_Give_Points
( amount: Integer );

Queue_Message

procedure Queue_Message
( text: String;
icon: String := "";
textAlign: Align_Type := Align_Right );