1. package Tiles.Matrices is 
  2.  
  3.     -- maximum size of a matrix in either dimension 
  4.     MAX_MATRIX_SIZE : constant := 32; 
  5.  
  6.     ---------------------------------------------------------------------------- 
  7.  
  8.     -- A Tile_Matrix is a two-dimensional array of tile ids. It is stored in the 
  9.     -- index file of a tile library and used to draw repeating tile patterns or 
  10.     -- large tile-based objects when editing a world map. 
  11.     type Tile_Matrix is array (Integer range <>, Integer range <>) of Integer; 
  12.     type A_Tile_Matrix is access all Tile_Matrix; 
  13.  
  14.     -- Returns a copy of the Tile_Matrix. 
  15.     function Copy( src : A_Tile_Matrix ) return A_Tile_Matrix; 
  16.     pragma Postcondition( Copy'Result /= src or else src = null ); 
  17.  
  18.     -- Deletes the Tile_Matrix. 
  19.     procedure Delete( m : in out A_Tile_Matrix ); 
  20.     pragma Postcondition( m = null ); 
  21.  
  22. private 
  23.  
  24.     function A_Tile_Matrix_Input( stream : access Root_Stream_Type'Class ) return A_Tile_Matrix; 
  25.     for A_Tile_Matrix'Input use A_Tile_Matrix_Input; 
  26.  
  27.     procedure A_Tile_Matrix_Output( stream : access Root_Stream_Type'Class; matrix : A_Tile_Matrix ); 
  28.     for A_Tile_Matrix'Output use A_Tile_Matrix_Output; 
  29.  
  30.     procedure A_Tile_Matrix_Read( stream : access Root_Stream_Type'Class; matrix : out A_Tile_Matrix ); 
  31.     for A_Tile_Matrix'Read use A_Tile_Matrix_Read; 
  32.  
  33.     procedure A_Tile_Matrix_Write( stream : access Root_Stream_Type'Class; matrix : A_Tile_Matrix ); 
  34.     for A_Tile_Matrix'Write use A_Tile_Matrix_Write; 
  35.  
  36. end Tiles.Matrices;