Tiledmap(3)                                                        Tiledmap(3)



NNAAMMEE
       Tiledmap -

SSYYNNOOPPSSIISS
       Inherited by AArreeaa, and MMaappaarreeaa.


   PPuubblliicc MMeetthhooddss
       void cclleeaarr__ggrriidd ()
       void rreessiizzee__ggrriidd (int xdim, int ydim, int zdim)
       void ooffffsseett__ggrriidd (int dx, int dy, int dz)
       int qquueerryy__xxddiimm ()
       int qquueerryy__yyddiimm ()
       int qquueerryy__zzddiimm ()
       string qquueerryy__ggrriidd ()
       string * qquueerryy__ggrriidd__vvaalluueess ()
       int qquueerryy__rroooomm__iinnddeexx (string name)
       private int ccoooorrdd__ttoo__iinnddeexx (int x, int y, int z)
       int qquueerryy__cceellll__iinnddeexx (int x, int y, int z)
       string qquueerryy__cceellll (int x, int y, int z)
       string qquueerryy__ggrriidd__vvaalluuee (int i)
       void sseett__ggrriidd__vvaalluueess (string *list)
       int sseett__cceellll__iinnddeexx (int x, int y, int z, int c)
       int sseett__cceellll (int x, int y, int z, string val)
       int rreemmoovvee__ggrriidd__vvaalluuee (string name)
       int rreemmoovvee__cceellll (int x, int y, int z)
       int sseett__ggrriidd__vvaalluuee (int i, string val)
       int qquueerryy__zzeexxtteenndd ()
       void sseett__zzeexxtteenndd (int i)
       int qquueerryy__hhaass__mmaapp ()

   PPuubblliicc AAttttrriibbuutteess
       string ggrriidd
       string * ggrriidd__vvaalluueess
       int ggrriidd__xxddiimm
       int ggrriidd__yyddiimm
       int ggrriidd__zzddiimm
       int zzeexxtteenndd

DDEETTAAIILLEEDD DDEESSCCRRIIPPTTIIOONN
       Designed to keep a square grid of values (0-254, stored 1-255) which
       index into an array of other values (Typically strings). Intended,
       presently, for a grid stored in the area which indexes into the rooms
       there. When you request indices, they are mapped from 1-255 to 0-254 to
       be more familiar to users, but this is not how they're stored.

       This component has an unusual feature called 'z extension'. All area
       objects are treated like giant cubes floating in world space, and this
       component is used to track where they are located (it can be used for
       things other than areas of course). Generally, the entire cube is
       filled with a grid that allows you to figure out exactly where
       everything in the area is. However, sometimes you want to stretch the
       area out vertically (say, adding some sky or underground) but don't
       want to actually fill the grid in there, because it takes too much
       memory. This is the purpose of z extension.

       The z extension can either go up or down, and the extended shape will
       still be a cube. For example, an area that is 10x10x1, with a zextend
       of 1, has a grid with 100 cells and a 'virtual' grid with 200 cells and
       of the same x and y dimensions sitting on top of it. The actual cells
       of this virtual grid are not stored. They're purely imaginary. A
       negative z extension does the same thing, only the extension goes
       downward instead of up.

       Note that you can make a 'meta-area' using this mechanism. Simply make
       a grid with a z height of ZERO, and then set x, y, and z extension to
       the meta-area dimensions. Meta-areas generally should only hold other
       areas, as they can't hold rooms too well (it'll do ok for things like
       ocean though).

       Definition at line 28 of file tiledmap.c.

MMEEMMBBEERR FFUUNNCCTTIIOONN DDOOCCUUMMEENNTTAATTIIOONN
   vvooiidd cclleeaarr__ggrriidd (())
       Wipes the values off the grid (setting them to 254; actually 255, but
       all values are offset by 1 so that \0 is -1).

       Definition at line 40 of file tiledmap.c.

       References grid, grid_values, grid_xdim, grid_ydim, and grid_zdim.

       Referenced by resize_grid().

   pprriivvaattee iinntt ccoooorrdd__ttoo__iinnddeexx ((iinntt xx,, iinntt yy,, iinntt zz))
       RReettuurrnnss::
           An index directly into the grid array, translated from the *local*
           coordinate x, y, z. Remember that if you want world coordinates,
           you must add on the offsets yourself (query_x(), query_y(),
           query_z()).

       Definition at line 134 of file tiledmap.c.

       References grid_xdim, grid_ydim, and grid_zdim.

       Referenced by query_cell_index(), remove_cell(), set_cell(), and
       set_cell_index().

   vvooiidd ooffffsseett__ggrriidd ((iinntt ddxx,, iinntt ddyy,, iinntt ddzz))
       Allows you to shift the grid around. Useful if you want to add more
       rooms on the left side, i.e. The amount to shift by is given as a delta
       value in x, y, and z.

       Definition at line 72 of file tiledmap.c.

       References grid, grid_xdim, grid_ydim, and grid_zdim.

   ssttrriinngg qquueerryy__cceellll ((iinntt xx,, iinntt yy,, iinntt zz))
       Returns the grid value for a cell, referenced into the array of grid
       values. Returns 0 if no value is available (Note that you will
       generally get a zero back for empty cells).

       Definition at line 159 of file tiledmap.c.

       References grid_values, and query_cell_index().

   iinntt qquueerryy__cceellll__iinnddeexx ((iinntt xx,, iinntt yy,, iinntt zz))
       RReettuurrnnss::
           -1 if something is really wrong (either there is no grid, or the
           coordinate is out of bounds); otherwise, returns the index value of
           the given grid cell.

       Definition at line 145 of file tiledmap.c.

       References coord_to_index(), and grid.

       Referenced by query_cell().

   ssttrriinngg qquueerryy__ggrriidd (())
       If your functions want to deal with grid data directly, use this.

       Definition at line 110 of file tiledmap.c.

       References grid.

   ssttrriinngg qquueerryy__ggrriidd__vvaalluuee ((iinntt ii))
       RReettuurrnnss::
           The _i 'th entry from the grid values (grid values are usually room
           references).

       Definition at line 170 of file tiledmap.c.

       References grid_values.

   ssttrriinngg** qquueerryy__ggrriidd__vvaalluueess (())
       RReettuurrnnss::
           The array of grid values. Primarily useful for tight inner loops
           where you want speed over simplicity.

       Definition at line 115 of file tiledmap.c.

       References grid_values.

   iinntt qquueerryy__hhaass__mmaapp (())
       Makes the coordinate code behave; slight conflict with the map_paint()
       implementation, but it isn't severe, and you shouldn't be using
       tiledmap and map_paint together in the same object anyway.

       Definition at line 320 of file tiledmap.c.

   iinntt qquueerryy__rroooomm__iinnddeexx ((ssttrriinngg nnaammee))
       RReettuurrnnss::
           The index associated with _n_a_m_e. If you want the literal value for
           the grid array, add 1 to this value.The value is -1 if _n_a_m_e is not
           found in the grid values. Roughly the same as
           member(qquueerryy__ggrriidd__vvaalluueess(()), name), but with more error checking.

       Definition at line 124 of file tiledmap.c.

       References grid_values.

   iinntt qquueerryy__xxddiimm (())
       Allows you to query the x-dimension of the grid. You must use
       rreessiizzee__ggrriidd(()) to change this dimension.

       Definition at line 97 of file tiledmap.c.

       References grid_xdim.

   iinntt qquueerryy__yyddiimm (())
       Allows you to query the y-dimension of the grid. You must use
       rreessiizzee__ggrriidd(()) to change this dimension.

       Definition at line 102 of file tiledmap.c.

       References grid_ydim.

   iinntt qquueerryy__zzddiimm (())
       Allows you to query the z-dimension of the grid. You must use
       rreessiizzee__ggrriidd(()) to change this dimension.

       Definition at line 107 of file tiledmap.c.

       References grid_zdim.

   iinntt qquueerryy__zzeexxtteenndd (())
       RReettuurrnnss::
           The z extension (ungridded area of this cube). See the introduction
           to this object for an explanation.

       Definition at line 307 of file tiledmap.c.

       References zextend.

   iinntt rreemmoovvee__cceellll ((iinntt xx,, iinntt yy,, iinntt zz))
       Calls this to blank out a single cell. This has the additional effect
       of deleting the room from the grid_values list if the cell deleted was
       the last instance of that room on the map.

       RReettuurrnnss::
           True if removing the cell deleted the room completely, false if
           not.

       Definition at line 269 of file tiledmap.c.

       References coord_to_index(), grid, and grid_values.

   iinntt rreemmoovvee__ggrriidd__vvaalluuee ((ssttrriinngg nnaammee))
       Calls this to remove all data related to entry /a name in this map.
       This could be used, for example, to reset the data for a room in the
       area inheriting this object.

       RReettuurrnnss::
           True if any data was removed, false if there was nothing to remove.

       Definition at line 246 of file tiledmap.c.

       References grid, and grid_values.

   vvooiidd rreessiizzee__ggrriidd ((iinntt xxddiimm,, iinntt yyddiimm,, iinntt zzddiimm))
       Sets the grid size to xdim by ydim and then clears the grid. There is
       some attempt to preserve the values that were on the grid before, but
       if you shrink it you'll obviously lose something.

       Definition at line 51 of file tiledmap.c.

       References clear_grid(), grid, grid_xdim, grid_ydim, and grid_zdim.

   iinntt sseett__cceellll ((iinntt xx,, iinntt yy,, iinntt zz,, ssttrriinngg vvaall))
       The high level 'convenient' way to set room values. It will search
       grid_values for a value matching _v_a_l, and create it if there is room
       and it's not present. It will then use the relevant index for the grid
       position.

       RReettuurrnnss::
           True on success, false otherwise.

       PPaarraammeetteerrss::

       _v_a_l    The string value to set at position _x, \ay, _z.

       Definition at line 214 of file tiledmap.c.

       References coord_to_index(), grid, and grid_values.

   iinntt sseett__cceellll__iinnddeexx ((iinntt xx,, iinntt yy,, iinntt zz,, iinntt cc))
       Lets you set the cell at position x, y, z in the grid to a given value
       c. _c maps into the array of grid values as an index. Note that x, y, z
       are local coordinates, relative to the grid. If you have world
       coordinates, you must adjust them first.

       To 'blank out' a value, pass in -1 for c.

       RReettuurrnnss::
           True on success, false on error (invalid values).

       Definition at line 190 of file tiledmap.c.

       References coord_to_index(), and grid.

   iinntt sseett__ggrriidd__vvaalluuee ((iinntt ii,, ssttrriinngg vvaall))
       Sets entry _i of the grid values to _v_a_l.

       RReettuurrnnss::
           True on success, false if any of the inputs are invalid (You need
           to make sure that 0 >= i >= 254).

       Definition at line 297 of file tiledmap.c.

       References grid_values.

   vvooiidd sseett__ggrriidd__vvaalluueess ((ssttrriinngg ** lliisstt))
       Initialize all of the grid values at once. Allows for external editing.

       Definition at line 177 of file tiledmap.c.

       References grid_values.

   vvooiidd sseett__zzeexxtteenndd ((iinntt ii))
       Sets the z extension to i (positive = up, negative = down).

       Definition at line 312 of file tiledmap.c.

       References zextend.

MMEEMMBBEERR DDAATTAA DDOOCCUUMMEENNTTAATTIIOONN
   ssttrriinngg ggrriidd
       The grid itself.

       Definition at line 32 of file tiledmap.c.

       Referenced by clear_grid(), offset_grid(), query_cell_index(),
       query_grid(), remove_cell(), remove_grid_value(), resize_grid(),
       set_cell(), and set_cell_index().

   ssttrriinngg** ggrriidd__vvaalluueess
       A table (array) of the meanings of the various grid indices. Translates
       the grid into something meaningful.

       Definition at line 34 of file tiledmap.c.

       Referenced by clear_grid(), query_cell(), query_grid_value(),
       query_grid_values(), query_room_index(), remove_cell(),
       remove_grid_value(), set_cell(), set_grid_value(), and
       set_grid_values().

   iinntt ggrriidd__xxddiimm
       Dimension of the grid (it is a 3d cube).

       Definition at line 36 of file tiledmap.c.

       Referenced by clear_grid(), coord_to_index(), offset_grid(),
       query_xdim(), and resize_grid().

   iinntt ggrriidd__yyddiimm
       Dimension of the grid (it is a 3d cube).

       Definition at line 36 of file tiledmap.c.

       Referenced by clear_grid(), coord_to_index(), offset_grid(),
       query_ydim(), and resize_grid().

   iinntt ggrriidd__zzddiimm
       Dimension of the grid (it is a 3d cube).

       Definition at line 36 of file tiledmap.c.

       Referenced by clear_grid(), coord_to_index(), offset_grid(),
       query_zdim(), and resize_grid().

   iinntt zzeexxtteenndd
       This is to allow the cube covered by the map be larger than the grid
       itself in the z direction.

       Definition at line 38 of file tiledmap.c.

       Referenced by query_zextend(), and set_zextend().


AAUUTTHHOORR
       Generated automatically by Doxygen for Walraven from the source code.



Walraven                          8 Jan 2004                       Tiledmap(3)
