Class Item



    Description

    An item is a mazeObject in the map data. An item can belongs to a block, a room, or a player.

    Structure

    An item has a selfId to distinguish it from other mazeObjects and a belongId which is the id of the owner of this item.

    The variable name, desc are strings each stores the name of the item and some short description about this item. The variable offsetX, offsetY indicates the position of the item in a block or in a room.

    The class Item has methods getX(), getY() to get the position of the item. It also has methods Take() and Drop() to take and drop the item.

    The method producingMessage() is to produce a MsgItem message of this item.

    See also

    mazeObject
    Block
    Room
    Door
    Player




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