with Objects; use Objects;
with Maps; use Maps;
private with Tiles.Libraries;
package Physics.Clip_Maps is
type Clip_Map is new Object with private;
type A_Clip_Map is access all Clip_Map'Class;
function Create_Clip_Map( width,
height,
tileWidth : Positive;
mapLayers : not null A_Layer_Array;
libName : String ) return A_Clip_Map;
pragma Precondition( libName'Length > 0 );
pragma Postcondition( Create_Clip_Map'Result /= null );
function Get( this : not null access Clip_Map'Class;
x, y : Float ) return Clip_Type;
function Get( this : not null access Clip_Map'Class;
x, y : Integer ) return Clip_Type;
function Get_Height( this : not null access Clip_Map'Class ) return Positive;
function Get_Width( this : not null access Clip_Map'Class ) return Positive;
procedure Set_Tile( this : not null access Clip_Map'Class;
id : Natural;
x, y : Natural;
layer : Natural );
function Tile_Width( this : not null access Clip_Map'Class ) return Positive;
procedure Delete( this : in out A_Clip_Map );
pragma Postcondition( this = null );
private
use Tiles.Libraries;
type Clip_Layer is array (Natural range <>) of Clip_Type;
type A_Clip_Layer is access all Clip_Layer;
type Clip_Map is new Object with
record
mapWidth,
mapHeight,
mapWidthTiles,
mapHeightTiles,
tileWidth : Positive := 1;
mapLayers : A_Layer_Array := null;
clipLayer : A_Clip_Layer := null;
lib : A_Tile_Library := null;
end record;
procedure Calculate_Clipping( this : not null access Clip_Map'Class;
x, y : Integer );
procedure Construct( this : access Clip_Map;
width,
height,
tileWidth : Positive;
mapLayers : not null A_Layer_Array;
libName : String );
procedure Delete( this : in out Clip_Map );
end Physics.Clip_Maps;