1   import java.awt.*;
2   import java.awt.event.*;
3   import java.applet.*;
4   import java.awt.geom.*;
5   import java.util.*;
6   /**
7    * Simple Event to tell Game to load a new Map.
8    * 
9    * @see Game
10   * @see Grid
11   * @see MapLoader
12   * @see Redirect
13   */
14  public class RedirectEvent extends AWTEvent 
15  {
16      /**
17       * The filename
18       */
19      String mapName;
20      /**
21       * The Player
22       */
23      Player p;
24      /**
25       * the UID
26       */
27      public static final int REDIRECT_FIRED = RESERVED_ID_MAX + 10;  // Make sure no conflicts with normal AWT components
28  
29      /**
30       * Construct a new Event with the Grid and Player.
31       * 
32       * @param source the Grid
33       * @param player the Player
34       * @see Grid
35       * @see Redirect
36       * @see Player
37       */
38      RedirectEvent(Grid source, int id, String mapName, Player player)
39      {
40          super( source, id );
41          this.mapName = mapName;
42          p = player;
43      }
44      /**
45       * Returns the filename for the new map.
46       * 
47       * @return the filename for the new map.
48       */
49      public String getMapName() { return mapName; }
50      /**
51       * Returns the Player to be placed on the new map.
52       * 
53       * @return the Player to be placed on the new map..
54       */
55      public Player getPlayer() { return p; }
56  }