Class mapStructure



    Purpose

    mapStructure is used to store the map data. It offers all the methods for constructing map data. , retriving map data, and updating map data.

    Structure

    Variable

  • BlockTable which is a hash table used to store blocks in the map.
  • DataSyncTable : a hashtable records the state of a block. if there is a record in this table, it means the block is either request but not come yet (value 0), wait for that block (value 1), come and wake up anyone who is waiting that block (value 2).

    Methods

    The methods consBlock, addBlock, consRoom, addRoom, consDoor, addDoor, consItem, addItem, consPlayer, and addPlayer are used to construct those mazeObjects to the mapStructure. The method getBlock is used to get the certain block at the specified row and column.

    The methods exportAll(PrintStream) and exportBlock(int Row, int Col, PrintStream) are used to export all the blocks or the certain block in the mapStructure.

    The rest of the methods such as needMoreBlock, enterBlock, conSimPlayer, ServerUpdateMove, etc. are used to update the mapStructure.

    See also

    mazeObject
    Block
    Room
    Door
    Item
    Player




    [Go to Class Index Table] [Go back to Program Architecture Diagram]
    [Source Code of mapStructure.java]