Class Room



    Description

    A room is a mazeObject in a block. A room can have doors, items, and players in it. Each room has its identical id to distinguish it from other mazeObjects and also has an belongId to indicate which block does this room belong to.

    Structure

    A room has three hash tables each for storing doors, items, and players in the room.

    The variables selfId, belongId are the id of the room and the id of the block the room belongs to.

    The variables offsetX, offsetY, Width, Height indicates the position of the room in the block and the size of the room.

    The methods addDoor, addItem, removeItem, addPlayer, removePlayer ServerUpdateMove are used to construct and update the room.

    The method producingMessage() is to generate a MsgRoom message of this room and the method export(PrintStream) is to export all the mazeObjects in the room to the specified PrintStream.

    See also

    mazeObject
    Block
    Door
    Item
    Player




    [Go to Class Index Table] [Go back to Program Architecture Diagram]
    [< a href="src/AllObjects.java">Source Code of AllObjects.java]