Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.rs2hd.content;
- import java.util.HashMap;
- import com.rs2hd.GameEngine;
- import com.rs2hd.model.Player;
- /**
- * @author Storm
- * Creates a new shop, handles the shops + special shops
- */
- public class ShopHandler {
- private HashMap<Integer, Shop> shops = new HashMap<Integer, Shop>();
- public void loadShops() {
- shops.put(1, new Shop(1, true, new int[] {1704, 1925}, new int[] {1000, 1000}));
- shops.put(2, new Shop(2, false, GameEngine.shops.Shop,
- GameEngine.shops.ShopN));
- shops.put(3, new Shop(3, false, GameEngine.shops.testshop,
- GameEngine.shops.testshopN));
- }
- /**
- * Opens the shop for the player
- * @param p, the player
- * @param Id, the shop id
- */
- public void openShop(Player p, int Id) {
- p.getActionSender().sendMessage("Restart the client if shops aren't working.");
- p.shopId = Id;
- shops.get(Id).openForPlayer(p);
- shops.get(Id).addPlayer(p);
- }
- public Shop getShop(int Id) {
- return shops.get(Id);
- }
- //For users who don't believe in conventions
- public void openshop(Player p, int Id) {
- openShop(p, Id);
- }
- }
Add Comment
Please, Sign In to add comment