Class GlobalData



    Purpose

    GlobalData keeps all the data needed during the life time of a client or the server. Because of the different data need in a client and a server, two subclasses ServerGlobal and ClientGlobal are designed for the server and a client respectively.

    Structure

    Variables

    mazeObjectTable: A hash table to store all the mazeObjects.
    map: A mapStructure to keep the map data.


    Methods

    addObject(mazeObject) : Add the mazeObject to the mazeObjectTable.
    getObject(int) : Get the mazeObject whose id is the same as the input integer.
    removeObject(int) : remove the mazeObject whose id is the same as the input integer from the mazeObjectTable.

    Extension

    When extending this project, if you find some new data is needed all over the project, you can simplily put it here. Or if the new data is especially for the server or a client, you can put it in ServerGlobal or ClientGlobal.

    See also

    ServerGlobal
    ClientGlobal



    [Go to Class Index Table] [Go back to Program Architecture Diagram]