/*
 *
 *   ^   |    sssss p   ddddd  fff  ggggg hhhh   iii  j   j    |   ^
 *  /|\  |    s     p   d     f   f   g   h   h i   i jj  j    |  /|\
 *   |   |    sss   p   ddd   f       g   hhhh  i   i j j j    |   |
 *   |  \|/   s     p   d     f   f   g   h   h i   i j  jj   \|/  |
 *   |   v    sssss ppp ddddd  fff    g   h   h  iii  j   j    v   |
 *
 *                           copyright 1999
 *                  Martijn Versteegh & Hein Zelle
 *
 */

/*
 *         MAP.txt
 *
 *         format specification of map files
 *
 *         05-07-2000
 */

Electron now features a reasonably well defined file format for
creating new maps. This file is an attempt to explain and specify the
format. It may change a lot still, so keep an eye on the date at the
top of the file.

First of all, electron map files may contain as many comments as you
like. The parser understands end of line (C++ style) comments, as well
as (C style) block comments. Recursive block comments are not
supported.

       // comment until the end of the line

       /*
               ---
               multi line block comment
	       ---
        */

       /*
            /*
                   this does not work: comment block ends
                   at the first end marker
             */
        */
  
Newlines, extra spaces and tabs are ignored in map files, so you may
add as much indentation as you like for readability.

All keywords (SIZE, NAME, START, TAG, FOR) are case insensitive.

File Format: (ignore comments)

------------------------

SIZE < width, height >      // specify map width and height. obligatory
                            // this MUST be the first entry in the file.

NAME "name of the map"      // obligatory, must occur once in the file

START < x, y >              // specify start / reset point of the map
                            // obligatory, must occur once in the file
                            // must refer to a valid atom. The atom
                            // may be defined later in the file, so
                            // you may place this at the top

[atom]                      // follows a list of atoms
[atom]                      // see below for definition of [atom]
[atom]
  .
  .
  .

<<EOF>>                     // map ends at end of file

------------------------

definition of [atom]:

<x, y>                      // define an atom at position <x, y>
{                           // block braces are obligatory

    [electron]              // each atom must contain exactly ONE
                            // electron: the top level object.
                            // this must be a room. see below for definition
}                           // of [electron]

definiton of [electron]:

actor_type;                 // actor type is the type_name field with
                            // spaces replaced by underscores, eg
                            // lightcycle, blue_ball, simple_room
                            // electrons defined in this way have no
                            // tag, no link to other electrons and an
                            // empty inventory.
                
or

actor_type
{
    tag str1                // optional: give this electron a label
                            // 'str1' to refer to it in other places
 
    for str2                // optional: link this electron (for
                            // example a key) to electron with tag
                            // 'str2'. This only works for keys.

    [electron]              // optional: electrons to put in inventory
    [electron]              // of this electron. These may contain an inventory
        .                   // block for themselves, too.
        .
}

Examples:

SIZE <20, 20>               // define maximum map size
NAME "Test Map v1.0"
START <2, 2>                // reset point of the map

<1, 1>                      // create an atom with just a simple room
{
    simple_room;
}

<1, 2>
{
    simple_room             // put a tank in this room
    {
	tank
	{
	    tag tank1       // name it 'tank1'
	}
    }
}

<2, 1>
{
    simple_room
    {
	key                 // put a key in this room
	{
	    for tank1       // it belongs to 'tank1'
	}
    }
}

<2, 2>
{
    simple_room;
}
