Advertisement
Guest User

Untitled

a guest
Sep 24th, 2011
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. import java.awt.Point;
  2.  
  3. public class Area
  4. {
  5.     protected Point coordinates;
  6.     protected String description;
  7.     protected int encounterChance;
  8.    
  9.     public Area(int x, int y, String description, int encounterChance)
  10.     {
  11.         coordinates.setLocation(x, y);
  12.         this.description = description;
  13.         this.encounterChance = encounterChance;
  14.     }
  15.    
  16.     public Area(Point coordinates, String description, int encounterChance)
  17.     {
  18.         this.coordinates = coordinates;
  19.         this.description = description;
  20.         this.encounterChance = encounterChance;
  21.     }
  22.    
  23.     public String getDescription()
  24.     {
  25.         return description;
  26.     }
  27.    
  28.     public int getX()
  29.     {
  30.         return (int) coordinates.getX();
  31.     }
  32.    
  33.     public int getY()
  34.     {
  35.         return (int) coordinates.getY();
  36.     }
  37.    
  38.     public int getEncounterChance()
  39.     {
  40.         return encounterChance;
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement