rlgamekit.demo.walkaround
Class MapControl

java.lang.Object
  extended by rlgamekit.demo.walkaround.MapControl

public class MapControl
extends java.lang.Object

Controller class for map altering actions.


Constructor Summary
MapControl(javax.swing.JFrame parent, MapDisplay mapDisplay)
           
 
Method Summary
 void doBump(Player player, int feature, int color, int mapX, int mapY)
          Handle event if player bumped into something.
 void doClose(Player player, int mapX, int mapY)
          Do a close type action.
 void doDropItem(Player player)
          Drop an item from the players inventory.
 void makeNewMap(Player player)
          Create a new map and set the display up with the new map data.
 void playerMoved(Player player)
          Call this after player move to update the field of view.
 Item selectItemFromInventory(Player player)
          Select an item from the players inventory.
 void setMessageDisplayArea(MessageDisplayArea messageDisplayArea)
          Set message area to display game messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapControl

public MapControl(javax.swing.JFrame parent,
                  MapDisplay mapDisplay)
Method Detail

doBump

public void doBump(Player player,
                   int feature,
                   int color,
                   int mapX,
                   int mapY)
Handle event if player bumped into something.

Parameters:
feature - What was there?
color - The color of the feature.
mapX - X coordinate of the feature.
mapY - Y coordinate of the feature.

doClose

public void doClose(Player player,
                    int mapX,
                    int mapY)
Do a close type action. Will reset mode to MODE_MOVE after being triggered.


doDropItem

public void doDropItem(Player player)
Drop an item from the players inventory.

Parameters:
player - The player.

selectItemFromInventory

public Item selectItemFromInventory(Player player)
Select an item from the players inventory.

Parameters:
player - The player.
Returns:
The selected item or null if no item was selected.

playerMoved

public void playerMoved(Player player)
Call this after player move to update the field of view.

Parameters:
player - The player to update.

makeNewMap

public void makeNewMap(Player player)
Create a new map and set the display up with the new map data.


setMessageDisplayArea

public void setMessageDisplayArea(MessageDisplayArea messageDisplayArea)
Set message area to display game messages.

Parameters:
messageDisplayArea - Message are for gam,e messages. Pass null to trun message display off.