Index

Package: Worlds

Description

package Worlds is

Classes

World_Object (abstract)

type World_Object is abstract new Object and Event_Listener and Process with private;

Ancestors:

Immediate Children:

Worlds.Keen.Keen_World

Primitive operations:

Adjust (overriding Objects.Adjust)
Construct
Delete (overriding Objects.Delete)
Events.Listeners.To_String (Inherited)
Get_Process_Name (overriding Processes.Get_Process_Name)
Handle
Handle
Handle
Handle
Handle
Handle
Handle
Handle
Handle
Handle
Handle_Event (overriding Events.Listeners.Handle_Event)
Initialize
Object_Input
Object_Read (overriding Objects.Object_Read)
Object_Write (overriding Objects.Object_Write)
Objects.Construct (Inherited)
Objects.To_String (Inherited)
On_Attach
On_Detach
Queue_Load_Events
Set_Property
Spawn_Entity
Tick (overriding Processes.Tick)

References:

worlds.ads:43:10 (declaration)
worlds.adb:169:37 (reference)
worlds.adb:208:61 (reference)
worlds.adb:228:44 (reference)
worlds.adb:260:37 (reference)
worlds.adb:286:61 (reference)
worlds.adb:303:40 (reference)
worlds.adb:314:49 (reference)
worlds.adb:325:55 (reference)
worlds.adb:336:50 (reference)
worlds.adb:343:48 (reference)
worlds.adb:350:49 (reference)
worlds.adb:358:46 (reference)
worlds.adb:369:51 (reference)
worlds.adb:392:48 (reference)
worlds.adb:403:54 (reference)
worlds.adb:415:37 (reference)
worlds.adb:434:37 (reference)
worlds.adb:446:37 (reference)
worlds.adb:458:37 (reference)
worlds.adb:477:37 (reference)
worlds.adb:489:37 (reference)
worlds.adb:501:37 (reference)
worlds.adb:516:37 (reference)
worlds.adb:529:37 (reference)
worlds.adb:544:37 (reference)
worlds.adb:555:43 (reference)
worlds.adb:586:41 (reference)
worlds.adb:601:40 (reference)
worlds.adb:621:40 (reference)
worlds.adb:640:48 (reference)
worlds.adb:669:48 (reference)
worlds.adb:742:49 (reference)
worlds.adb:780:43 (reference)
worlds.adb:808:41 (reference)
worlds.adb:848:45 (reference)
worlds.adb:891:35 (reference)
worlds.adb:970:49 (reference)
worlds.adb:1034:22 (reference)
worlds.adb:1034:42 (reference)
worlds.adb:1049:9 (reference)
worlds.adb:1055:78 (reference)
worlds.adb:1104:75 (reference)
worlds.ads:44:32 (reference)
worlds.ads:61:61 (reference)
worlds.ads:67:61 (reference)
worlds.ads:71:40 (reference)
worlds.ads:74:49 (reference)
worlds.ads:77:55 (reference)
worlds.ads:80:50 (reference)
worlds.ads:83:48 (reference)
worlds.ads:87:49 (reference)
worlds.ads:90:51 (reference)
worlds.ads:95:48 (reference)
worlds.ads:98:54 (reference)
worlds.ads:101:48 (reference)
worlds.ads:107:49 (reference)
worlds.ads:116:43 (reference)
worlds.ads:120:41 (reference)
worlds.ads:129:45 (reference)
worlds.ads:137:49 (reference)
worlds.ads:139:76 (reference)
worlds.ads:213:10 (full declaration)
worlds.ads:230:37 (reference)
worlds.ads:236:44 (reference)
worlds.ads:242:37 (reference)
worlds.ads:244:41 (reference)
worlds.ads:246:46 (reference)
worlds.ads:249:37 (reference)
worlds.ads:251:37 (reference)
worlds.ads:253:37 (reference)
worlds.ads:255:37 (reference)
worlds.ads:257:37 (reference)
worlds.ads:259:37 (reference)
worlds.ads:261:37 (reference)
worlds.ads:263:37 (reference)
worlds.ads:265:37 (reference)
worlds.ads:267:37 (reference)
worlds.ads:269:43 (reference)
worlds.ads:274:78 (reference)
worlds.ads:275:9 (reference)
worlds.ads:277:75 (reference)
worlds.ads:278:9 (reference)
worlds.ads:281:40 (reference)
worlds.ads:283:40 (reference)
worlds.ads:286:48 (reference)
worlds.ads:288:35 (reference)
worlds-keen.adb:38:9 (reference)
worlds-keen.adb:53:9 (reference)
worlds-keen.adb:73:9 (reference)
worlds-keen.adb:89:13 (reference)
worlds-keen.adb:109:9 (reference)
worlds-keen.adb:109:36 (reference)
worlds-keen.adb:118:9 (reference)
worlds-keen.adb:118:37 (reference)
worlds-keen.ads:8:28 (reference)

Types

A_World

type A_World is access all World_Object'Class;

References:

worlds.ads:44:10 (declaration)
games.adb:208:69 (reference)
games.ads:72:27 (reference)
games.ads:113:69 (reference)
worlds.adb:89:54 (reference)
worlds.adb:90:16 (reference)
worlds.adb:107:17 (reference)
worlds.adb:112:58 (reference)
worlds.adb:113:17 (reference)
worlds.adb:115:18 (reference)
worlds.adb:132:49 (reference)
worlds.adb:136:20 (reference)
worlds.adb:217:13 (reference)
worlds.adb:289:13 (reference)
worlds.adb:546:9 (reference)
worlds.adb:561:13 (reference)
worlds.adb:563:13 (reference)
worlds.adb:565:13 (reference)
worlds.adb:567:13 (reference)
worlds.adb:569:13 (reference)
worlds.adb:571:13 (reference)
worlds.adb:573:13 (reference)
worlds.adb:575:13 (reference)
worlds.adb:577:13 (reference)
worlds.adb:579:13 (reference)
worlds.adb:615:9 (reference)
worlds.adb:734:17 (reference)
worlds.adb:754:17 (reference)
worlds.adb:754:37 (reference)
worlds.adb:977:26 (reference)
worlds.adb:977:43 (reference)
worlds.adb:979:16 (reference)
worlds.adb:984:37 (reference)
worlds.adb:991:77 (reference)
worlds.adb:992:17 (reference)
worlds.adb:1002:21 (reference)
worlds.adb:1020:79 (reference)
worlds.adb:1026:13 (reference)
worlds.adb:1032:81 (reference)
worlds.adb:1047:78 (reference)
worlds.ads:50:54 (reference)
worlds.ads:56:49 (reference)
worlds.ads:141:26 (reference)
worlds.ads:141:43 (reference)
worlds.ads:144:37 (reference)
worlds.ads:290:77 (reference)
worlds.ads:291:9 (reference)
worlds.ads:293:79 (reference)
worlds.ads:294:9 (reference)
worlds.ads:296:81 (reference)
worlds.ads:297:9 (reference)
worlds.ads:299:78 (reference)
worlds.ads:300:9 (reference)
worlds.ads:308:52 (reference)
worlds-keen.adb:21:54 (reference)
worlds-keen.adb:25:16 (reference)
worlds-keen.adb:28:21 (reference)

Constants & Global variables

FILE_NOT_FOUND

FILE_NOT_FOUND,
    READ_EXCEPTION,
    WRITE_EXCEPTION : exception;

References:

worlds.ads:154:5 (declaration)
worlds.adb:153:19 (reference)

READ_EXCEPTION

READ_EXCEPTION,
    WRITE_EXCEPTION : exception;

References:

worlds.ads:155:5 (declaration)
worlds.adb:150:23 (reference)
worlds.adb:1005:23 (reference)
worlds.adb:1009:19 (reference)

WRITE_EXCEPTION

WRITE_EXCEPTION : exception;

References:

worlds.ads:156:5 (declaration)
worlds.adb:760:23 (reference)
worlds.adb:763:19 (reference)
worlds.adb:767:19 (reference)
worlds.adb:769:14 (reference)
worlds.adb:772:19 (reference)

Subprograms & Entries

Create_World

function Create_World
( width, height: Positive;
libName, domain: String )
return A_World;

References:

worlds.ads:47:14 (declaration)
worlds.adb:86:14 (body)
worlds.adb:98:9 (label)
worlds.ads:53:27 (reference)
Creates a new empty world. An exception is raised on error.

Load_World

function Load_World
( name: String )
return A_World;

References:

worlds.ads:56:14 (declaration)
games.adb:164:29 (reference)
worlds.adb:132:14 (body)
worlds.adb:164:9 (label)
worlds.ads:57:27 (reference)

Called by:

Games.Load_World defined at games.ads:36:15
Loads a world from disk. An exception is raised on error.

Attach_To_Framework

procedure Attach_To_Framework
( this: not null access World_Object'Class;
corral: not null A_Corral;
pman: not null A_Process_Manager );

References:

worlds.ads:61:15 (declaration)
games.adb:216:24 (reference)
worlds.adb:208:15 (body)
worlds.adb:223:9 (label)

Called by:

Games.Set_World defined at games.ads:113:15
Attaches the world to the game framework to send and receive events and execute as a process.

Detach_From_Framework

procedure Detach_From_Framework
( this: not null access World_Object'Class );

References:

worlds.ads:67:15 (declaration)
games.adb:211:24 (reference)
games.adb:257:24 (reference)
worlds.adb:286:15 (body)
worlds.adb:298:9 (label)

Called by:

Games.Set_World defined at games.ads:113:15
Games.Stop defined at games.ads:46:15

Calls:

Debugging.Dbg defined at debugging.ads:58:15
On_Detach defined at worlds.ads:283:15
Processes.Managers.Detach defined at processes-managers.ads:33:15
Worlds.Destroy_World defined at worlds.adb:105:15
Detaches the world from the game framework, removing itself as an event listener and ceasing execution as a process.

Get_Entity

function Get_Entity
( this: access World_Object;
id: Entity_Id )
return A_Entity;

References:

worlds.ads:71:14 (declaration)
worlds.adb:303:14 (body)
worlds.adb:310:9 (label)
worlds.adb:352:30 (dispatching call)
worlds.adb:436:45 (reference)
worlds.adb:437:45 (reference)
worlds.adb:448:45 (reference)
worlds.adb:449:45 (reference)
worlds.adb:460:44 (reference)
worlds.adb:479:39 (reference)
worlds.adb:491:39 (reference)
worlds.adb:503:39 (reference)
worlds.adb:518:39 (reference)
worlds.adb:531:41 (reference)
games-keen.adb:110:29 (dispatching call)

Called by:

Games.Keen.Handle defined at games-keen.ads:34:15
Get_Player defined at worlds.ads:87:14
Handle defined at worlds.ads:255:15
Handle defined at worlds.ads:251:15
Handle defined at worlds.ads:257:15
Handle defined at worlds.ads:263:15
Handle defined at worlds.ads:253:15
Handle defined at worlds.ads:265:15
Handle defined at worlds.ads:261:15
Handle defined at worlds.ads:251:15
Handle defined at worlds.ads:253:15
Handle defined at worlds.ads:259:15

Calls:

Element defined at a-coorma.ads:73:13
Find defined at a-coorma.ads:151:13
Has_Element defined at a-coorma.ads:161:13
Returns a reference to an entity with the given id, or null if the entity doesn't exist.

Get_Height

function Get_Height
( this: not null access World_Object'Class )
return Positive;

References:

worlds.ads:74:14 (declaration)
worlds.adb:314:14 (body)
worlds.adb:321:9 (label)
worlds.adb:708:47 (reference)
worlds.adb:719:82 (reference)
entities-players-keen.adb:1003:48 (reference)
entities-players-keen.adb:1014:47 (reference)
worlds-keen.adb:59:68 (reference)

Called by:

Entities.Players.Keen.Tick defined at entities-players-keen.ads:111:15
Entities.Players.Keen.Tick defined at entities-players-keen.ads:111:15
Worlds.Keen.Construct defined at worlds-keen.ads:18:15
Worlds.Resize.Cull_Entities defined at worlds.adb:698:19
Worlds.Resize.Cull_Entities defined at worlds.adb:698:19
Returns the actual map height in pixels.

Get_Height_Tiles

function Get_Height_Tiles
( this: not null access World_Object'Class )
return Positive;

References:

worlds.ads:77:14 (declaration)
worlds.adb:325:14 (body)
worlds.adb:332:9 (label)

Calls:

Maps.Get_Height defined at maps.ads:43:14
Returns the height of the map in tiles.

Get_Library

function Get_Library
( this: not null access World_Object'Class )
return A_Tile_Library;

References:

worlds.ads:80:14 (declaration)
worlds.adb:336:14 (body)
worlds.adb:339:9 (label)
Returns the world's reference to its tile library. Do not modify it.

Get_Music

function Get_Music
( this: not null access World_Object'Class )
return String;

References:

worlds.ads:83:14 (declaration)
worlds.adb:343:14 (body)
worlds.adb:346:9 (label)

Calls:

To_String defined at a-strunb.ads:65:13
Returns the name of the background music track.

Get_Player

function Get_Player
( this: not null access World_Object'Class )
return A_Player;

References:

worlds.ads:87:14 (declaration)
worlds.adb:350:14 (body)
worlds.adb:353:9 (label)
games-keen.adb:146:34 (reference)

Called by:

Games.Keen.Pause defined at games-keen.ads:39:15

Calls:

Get_Entity defined at worlds.ads:71:14
Returns a reference to the world's current player entity. Do not modify it.

Get_Tile_Id

function Get_Tile_Id
( this: not null access World_Object'Class;
layer, x, y: Integer )
return Natural;

References:

worlds.ads:90:14 (declaration)
worlds.adb:369:14 (body)
worlds.adb:388:9 (label)

Calls:

Element defined at a-cohase.ads:114:13
Find defined at a-cohase.ads:292:13
Has_Element defined at a-cohase.ads:304:13
Is_Looping defined at worlds.ads:199:14
Maps.Get_Tile_Id defined at maps.ads:54:14
Returns the id of the tile at the specified location.

Get_Width

function Get_Width
( this: not null access World_Object'Class)
return Positive;

References:

worlds.ads:95:14 (declaration)
worlds.adb:392:14 (body)
worlds.adb:399:9 (label)
worlds.adb:707:47 (reference)
worlds.adb:718:82 (reference)
entities-players-keen.adb:1002:48 (reference)
entities-players-keen.adb:1013:47 (reference)
worlds-keen.adb:59:41 (reference)

Called by:

Entities.Players.Keen.Tick defined at entities-players-keen.ads:111:15
Entities.Players.Keen.Tick defined at entities-players-keen.ads:111:15
Worlds.Keen.Construct defined at worlds-keen.ads:18:15
Worlds.Resize.Cull_Entities defined at worlds.adb:698:19
Worlds.Resize.Cull_Entities defined at worlds.adb:698:19
Returns the actual map width in pixels.

Get_Width_Tiles

function Get_Width_Tiles
( this: not null access World_Object'Class )
return Positive;

References:

worlds.ads:98:14 (declaration)
worlds.adb:403:14 (body)
worlds.adb:410:9 (label)

Calls:

Maps.Get_Width defined at maps.ads:59:14
Returns the width of the map in tiles.

Resize

procedure Resize
( this: not null access World_Object'Class;
width, height: Positive );

References:

worlds.ads:101:15 (declaration)
worlds.adb:669:15 (body)
worlds.adb:738:9 (label)

Calls:

Events.World.Queue_World_Modified defined at events-world.ads:151:15
Maps.Get_Height defined at maps.ads:43:14
Maps.Get_Width defined at maps.ads:59:14
Maps.Resize defined at maps.ads:66:15
Queue_Load_Events defined at worlds.ads:286:15
Worlds.Resize.Cull_Animations defined at worlds.adb:676:19
Worlds.Resize.Cull_Entities defined at worlds.adb:698:19
Resizes the map. An exception is raised on error.

Save

procedure Save
( this: not null access World_Object'Class;
name: String;
overwrite: Boolean := True );

References:

worlds.ads:107:15 (declaration)
worlds.adb:742:15 (body)
worlds.adb:775:9 (label)

Calls:

Ada.Exceptions.Exception_Message defined at a-except.ads:101:13
Ada.Exceptions.Exception_Name defined at a-except.ads:79:13
Close defined at a-ststio.ads:80:14
Create defined at a-ststio.ads:68:14
Debugging.Dbg defined at debugging.ads:58:15
Events.World.Queue_World_Property_Changed defined at events-world.ads:157:15
Is_Open defined at a-ststio.ads:89:13
Is_Regular_File defined at s-os_lib.ads:469:13
Resources.Write_Path defined at resources.ads:110:14
Stream defined at a-ststio.ads:92:13
Support.Paths.Add_Extension defined at support-paths.ads:7:14
To_Unbounded_String defined at a-strunb.ads:59:13
World_Extension defined at worlds.ads:151:14
Writes the world in its current state to a file on disk. An exception is raised on error.

Set_Property

procedure Set_Property
( this: access World_Object;
name, value: String );

References:

worlds.ads:116:15 (declaration)
worlds.adb:780:15 (body)
worlds.adb:803:9 (label)
worlds-keen.adb:89:36 (reference)

Called by:

Worlds.Keen.Set_Property defined at worlds-keen.ads:30:15

Calls:

= defined at a-strunb.ads:139:13
Debugging.Dbg defined at debugging.ads:58:15
Events.World.Queue_World_Modified defined at events-world.ads:151:15
Events.World.Queue_World_Property_Changed defined at events-world.ads:157:15
To_Unbounded_String defined at a-strunb.ads:59:13
basic properties: "filename" : the filename "music" : the background music track name "domain" : determines player movement, physical rules

Set_Tile

procedure Set_Tile
( this: access World_Object;
layer: Integer;
x, y: Integer;
id: Natural;
notify: Boolean := True );

References:

worlds.ads:120:15 (declaration)
worlds.adb:808:15 (body)
worlds.adb:843:9 (label)

Calls:

+ defined at a-reatim.ads:57:13
Clock defined at a-reatim.ads:55:13
Delete defined at a-cohase.ads:203:14
Events.World.Queue_Tile_Changed defined at events-world.ads:147:15
Events.World.Queue_World_Modified defined at events-world.ads:151:15
Find defined at a-cohase.ads:292:13
Has_Element defined at a-cohase.ads:304:13
Include defined at a-cohase.ads:169:14
Maps.Get_Height defined at maps.ads:43:14
Maps.Get_Tile_Id defined at maps.ads:54:14
Maps.Get_Width defined at maps.ads:59:14
Maps.Set_Tile defined at maps.ads:71:15
Tiles.Copy defined at tiles.ads:32:14
Tiles.Get_Anm_Delay defined at tiles.ads:47:14
Tiles.Get_Frame_List defined at tiles.ads:62:14
Tiles.Is_Animated defined at tiles.ads:65:14
Tiles.Libraries.Get_Tile defined at tiles-libraries.ads:100:14
If 'notify' is True, Tile_Changed and World_Modified events will be sent.

Spawn_Entity

procedure Spawn_Entity
( this: access World_Object;
id: String;
x, y: Float;
width, height: Natural := 0;
xv, yv: Float := 0.0 );

References:

worlds.ads:129:15 (declaration)
worlds.adb:546:23 (dispatching call)
worlds.adb:848:15 (body)
worlds.adb:886:9 (label)

Called by:

Handle defined at worlds.ads:267:15
Spawns an entity of the given class id into the world. If 'width' or 'height' are equal to 0, the entity's natural width and height will be used.

Tile_Width

function Tile_Width
( this: not null access World_Object'Class )
return Positive;

References:

worlds.ads:137:14 (declaration)
worlds.adb:970:14 (body)
worlds.adb:973:9 (label)

Calls:

Maps.Tile_Width defined at maps.ads:77:14

Object_Input (abstract)

function Object_Input
( stream: access Root_Stream_Type'Class )
return World_Object is abstract;

References:

worlds.ads:139:14 (declaration)

Copy

function Copy
( src: A_World )
return A_World;

References:

worlds.ads:141:14 (declaration)
worlds.adb:977:14 (body)
worlds.adb:980:9 (label)

Calls:

Objects.Copy defined at objects.ads:42:14

Delete

procedure Delete
( this: in out A_World );

References:

worlds.ads:144:15 (declaration)
games.adb:67:9 (reference)
worlds.adb:107:9 (reference)
worlds.adb:126:13 (reference)
worlds.adb:159:13 (reference)
worlds.adb:984:15 (body)
worlds.adb:987:9 (label)
worlds.adb:1014:13 (reference)
worlds-keen.adb:28:13 (reference)

Called by:

A_World_Input defined at worlds.ads:290:14
Games.Delete defined at games.ads:81:15
Load_World defined at worlds.ads:56:14
Worlds.Destroy_World defined at worlds.adb:105:15
Worlds.Keen.Create_World defined at worlds-keen.adb:18:14
Worlds.Load_World defined at worlds.adb:112:14

Calls:

Objects.Delete defined at objects.ads:46:15

Valid_Domain

function Valid_Domain
( domain: String )
return Boolean;

References:

worlds.ads:149:14 (declaration)
worlds.adb:245:38 (reference)
worlds.adb:1092:16 (reference)
worlds.adb:1158:14 (body)
worlds.adb:1161:9 (label)

Called by:

Construct defined at worlds.ads:236:15
Object_Read defined at worlds.ads:274:15

Calls:

Contains defined at a-cihase.ads:299:13

World_Extension

function World_Extension return String;

References:

worlds.ads:151:14 (declaration)
worlds.adb:133:60 (reference)
worlds.adb:745:60 (reference)
worlds.adb:993:61 (reference)
worlds.adb:1022:56 (reference)
worlds.adb:1165:14 (body)
worlds.adb:1168:9 (label)
worlds.ads:152:27 (reference)

Called by:

A_World_Input defined at worlds.ads:290:14
A_World_Output defined at worlds.ads:293:15
Load_World defined at worlds.ads:56:14
Save defined at worlds.ads:107:15