Guest User

Untitled

a guest
Jul 19th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.08 KB | None | 0 0
  1. package com.rs2hd.content;
  2.  
  3. import java.util.HashMap;
  4.  
  5. import com.rs2hd.GameEngine;
  6. import com.rs2hd.model.Player;
  7.  
  8. /**
  9.  * @author Storm
  10.  * Creates a new shop, handles the shops + special shops
  11.  */
  12. public class ShopHandler {
  13.    
  14.     private HashMap<Integer, Shop> shops = new HashMap<Integer, Shop>();
  15.    
  16.     public void loadShops() {
  17.         shops.put(1, new Shop(1, true, new int[] {1704, 1925}, new int[] {1000, 1000}));
  18.         shops.put(2, new Shop(2, false, GameEngine.shops.Shop,
  19.                 GameEngine.shops.ShopN));
  20.         shops.put(3, new Shop(3, false, GameEngine.shops.testshop,
  21.                 GameEngine.shops.testshopN));
  22.     }
  23.    
  24.    
  25.     /**
  26.      * Opens the shop for the player
  27.      * @param p, the player
  28.      * @param Id, the shop id
  29.      */
  30.     public void openShop(Player p, int Id) {
  31.         p.getActionSender().sendMessage("Restart the client if shops aren't working.");
  32.         p.shopId = Id;
  33.         shops.get(Id).openForPlayer(p);
  34.         shops.get(Id).addPlayer(p);
  35.     }
  36.    
  37.     public Shop getShop(int Id) {
  38.         return shops.get(Id);
  39.     }
  40.    
  41.     //For users who don't believe in conventions
  42.     public void openshop(Player p, int Id) {
  43.         openShop(p, Id);
  44.     }
  45.  
  46. }
Add Comment
Please, Sign In to add comment