Thread: Array type resolved to hashtable

Results 1 to 3 of 3
  1. #1 Array type resolved to hashtable 
    Registered Member
    Enjoi's Avatar
    Join Date
    Sep 2008
    Posts
    2,454
    Thanks given
    565
    Thanks received
    281
    Rep Power
    1325
    Code:
    The type of the expression must be an array type but it resolved to Hashtable<Integer,NPC>


    Code:
    	private void handleSecondNPCClick(Player player, int packetSize) {
    		@SuppressWarnings("unused")
    		int npcSlot = ((Util.hexToInt(player.inStream.buffer, 0, packetSize) / 1000) - 128);
    		int npcID = NPCHandler.npcs[npcSlot].npcType;
    		switch (npcID) {
    		case 553:
    			player.openUpShop(2);
    			break;
    		case 522:
    			player.openUpShop(1);
    			break;
    		case 526:
    		case 527:
    			player.openUpShop(3);
    			break;
    		case 577:
    			player.openUpShop(4);
    			break;
    		case 580:
    			player.openUpShop(5);
    			break;
    		case 538:
    			player.openUpShop(6);
    			break;
    		case 546:
    			player.openUpShop(7);
    			break;
    		case 548:
    			player.openUpShop(8);
    			break;
    		case 551:
    		case 552:
    			player.openUpShop(9);
    			break;
    		case 549:
    			player.openUpShop(10);
    			break;	
    		case 550:
    			player.openUpShop(11);
    			break;
    		case 584:
    			player.openUpShop(12);
    			break;
    		case 581:
    			player.openUpShop(13);
    			break;
    		case 585:
    			player.openUpShop(14);
    			break;
    		case 530:
    		case 531:
    			player.openUpShop(15);
    			break;
    		case 1860:
    			player.openUpShop(16);
    			break;		
    		case 557:
    			player.openUpShop(17);
    			break;
    		case 558:
    			player.openUpShop(18);
    			break;
    		case 559:
    			player.openUpShop(19);
    			break;
    		case 556:
    			player.openUpShop(20);
    			break;
    		case 583:
    			player.openUpShop(21);
    			break;
    		case 520:
    		case 521:
    			player.openUpShop(22);
    			break;
    		case 519:
    			player.openUpShop(23);
    			break;
    		case 541:
    			player.openUpShop(24);
    			break;
    		case 545:
    			player.openUpShop(25);
    			break;
    		case 524:
    		case 525:
    			player.openUpShop(26);
    			break;
    		case 542:
    			player.openUpShop(27);
    			break;
    		case 544:
    			player.openUpShop(28);
    		case 587: 
    			player.openUpShop(29);
    			break;
    
    
    		}
    		// TODO Fix the below code, currently throws all sorts of exceptions 
    		// and acts extremely unpredictable.
    		/*int npcID = Server.npcHandler.npcs[npcSlot].npcType;		
    	}

    Code:
    	public static Hashtable<Integer, NPC> npcs = new Hashtable<Integer, NPC>(MAX_NPCS);
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Jan 2008
    Age
    28
    Posts
    1,380
    Thanks given
    76
    Thanks received
    384
    Rep Power
    962
    int npcID = NPCHander.npcs.get(npcSlot).npcType;
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    Enjoi's Avatar
    Join Date
    Sep 2008
    Posts
    2,454
    Thanks given
    565
    Thanks received
    281
    Rep Power
    1325
    Thank you very much.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Resolved
    By Xenon in forum Chat
    Replies: 2
    Last Post: 06-17-2010, 01:36 PM
  2. Resolved
    By Zebex in forum Help
    Replies: 0
    Last Post: 05-19-2010, 03:46 PM
  3. hashtable
    By .Sparrow in forum Help
    Replies: 2
    Last Post: 04-02-2010, 05:14 AM
  4. Replies: 4
    Last Post: 08-26-2009, 07:14 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •