Thread: Arrays Error

Results 1 to 3 of 3
  1. #1 Arrays Error 
    Endeavor

    Mikey`'s Avatar
    Join Date
    Dec 2007
    Posts
    4,434
    Thanks given
    715
    Thanks received
    1,435
    Rep Power
    1202
    Code:
    public static final int[] SCIMITAR =
    	{
    	566
    	};
    	
    	public static int getWeaponSound(Client c) 
    	{
    		if (c.playerEquipment[c.playerWeapon] == 4151) 
    		{
    			return 1080;
    		}
    	
    		if (c.playerEquipment[c.playerWeapon] == SCIMITAR)
    		{
    			return 396;
    		}
    Code:
    Building Server...
    src\server\model\content\Sounds.java:21: incomparable types: int and int[]
            if (c.playerEquipment[c.playerWeapon] == SCIMITAR)
                                                  ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    I can't use an Array because it's an integer method.. Is there another way to do this that's better?
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jul 2008
    Age
    28
    Posts
    5,827
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    Use a hashmap
    Reply With Quote  
     

  3. #3  
    Endeavor

    Mikey`'s Avatar
    Join Date
    Dec 2007
    Posts
    4,434
    Thanks given
    715
    Thanks received
    1,435
    Rep Power
    1202
    Quote Originally Posted by Colby View Post
    Use a hashmap
    Never have actually used it but I'll look up a tutorial on it, thanks.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •