English 中文(简体)
我的进口档案为什么不发挥作用?
原标题:Why does my import file not work?
  • 时间:2011-09-27 10:20:01
  •  标签:
  • java
  • import

我试图提出ClickingButtons案。 java要工作,但我正经历一个错误,它无法找到象征角色。 HasItem & freeSlots. 现在我尝试进口我的物品。 java 案卷,有公共 in子角色 HasItem & freeSlots, but after Save and codificationing it is still given the me the same wrong!

这是我在ClickingButtons的进口说明。 java:

import server.model.items.ItemAssistant;

这些是我的项目的公开部分:

    public int freeSlots()
{
    int freeS = 0;
    for (int i=0; i < c.playerItems.length; i++){
        if (c.playerItems[i] <= 0){
            freeS++;
        }
    }
    return freeS;
}

    public boolean playerHasItem(int itemID, int amt, int slot) {
    itemID++;
    int found = 0;
    if (c.playerItems[slot] == (itemID)) {
        for (int i = 0; i < c.playerItems.length; i++)  {
            if (c.playerItems[i] == itemID)  {
                if(c.playerItemsN[i] >= amt) {
                    return true;
                } else {
                    found++;
                }
            }
        }
        if(found >= amt) {
            return true;
        }
        return false;
    }
    return false;
}
public boolean playerHasItem(int itemID, int amt) {
    itemID++;
    int found = 0;
    for (int i = 0; i < c.playerItems.length; i++) {
        if (c.playerItems[i] == itemID) {
            if(c.playerItemsN[i] >= amt){
                return true;
            } else{
                found++;
            }
        }
    }
        if(found >= amt) {
            return true;
        }
        return false;
}

呼呼号为:

if (c.dialogueAction == 717) 
            {
                if (freeSlots() > 0)
                {
                    if (c.tempRune == 1)//air
                    {
                        if (c.omniQuest == 2)
                        {
                            if (c.getItems().playerHasItems(995,10000) && c.getItems().playerHasItems(556,10))
                                {
                                    c.getItems().deleteItems(995,10000);
                                    c.getItems().deleteItems(556,10);
                                    c.getItems().addItems(13599, 1);
                                    c.getDH().sendDialogues(749,57);
                                } else 
                                if (!c.getItems().playerHasItems(995,10000))
                                {
                                    c.getDH().sendDialogues(750, 57);
                                } else
                                if (!c.getItems().playerHasItems(556,10))
                                {
                                    c.getDH().sendDialogues(751, 57);
                                }
                        } else 
                        if (c.getItems().playerHasItems(995,20000) && c.getItems().playerHasItems(556,20))
                        {
                            c.getItems().deleteItems(995,20000);
                            c.getItems().deleteItems(556,20);
                            c.getItems().addItems(13599, 1);
                            c.getDH().sendDialogues(749,57);
                        } else
                        if (!c.getItems().playerHasItems(995,20000))
                        {
                            c.getDH().sendDialogues(750, 57);
                        } else
                        if (!c.getItems().playerHasItems(556,20))
                        {
                            c.getDH().sendDialogues(751, 57);
                        }
                    } else
                    if (c.tempRune == 6)//body
                    {
                        if (c.omniQuest == 2)
                        {
                            if (c.getItems().playerHasItems(995,10000) && c.getItems().playerHasItems(559,10))
                                {
                                    c.getItems().deleteItems(995,10000);
                                    c.getItems().deleteItems(559,10);
                                    c.getItems().addItems(13604, 1);
                                    c.getDH().sendDialogues(749,57);
                                } else 
                                if (!c.getItems().playerHasItems(995,10000))
                                {
                                    c.getDH().sendDialogues(750, 57);
                                } else
                                if (!c.getItems().playerHasItems(559,10))
                                {
                                    c.getDH().sendDialogues(751, 57);
                                }
                        } else 
                        if (c.getItems().playerHasItems(995,20000) && c.getItems().playerHasItems(559,20))
                        {
                            c.getItems().deleteItems(995,20000);
                            c.getItems().deleteItems(559,20);
                            c.getItems().addItems(13604, 1);
                            c.getDH().sendDialogues(749,57);
                        } else
                        if (!c.getItems().playerHasItems(995,20000))
                        {
                            c.getDH().sendDialogues(750, 57);
                        } else
                        if (!c.getItems().playerHasItems(559,20))
                        {
                            c.getDH().sendDialogues(751, 57);
                        }
                    } else
                    if (c.tempRune == 13)//astral 
                    {
                        if (c.omniQuest == 2)
                        {
                            if (c.getItems().playerHasItems(995,10000) && c.getItems().playerHasItems(9075,10))
                                {
                                    c.getItems().deleteItems(995,10000);
                                    c.getItems().deleteItems(9075,10);
                                    c.getItems().addItems(13611, 1);
                                    c.getDH().sendDialogues(749,57);
                                } else 
                                if (!c.getItems().playerHasItems(995,10000))
                                {
                                    c.getDH().sendDialogues(750, 57);
                                } else
                                if (!c.getItems().playerHasItems(9075,10))
                                {
                                    c.getDH().sendDialogues(751, 57);
                                }
                        } else 
                        if (c.getItems().playerHasItems(995,20000) && c.getItems().playerHasItems(9075,20))
                        {
                            c.getItems().deleteItems(995,20000);
                            c.getItems().deleteItems(9075,20);
                            c.getItems().addItems(13611, 1);
                            c.getDH().sendDialogues(749,57);
                        } else 
                        if (!c.getItems().playerHasItems(995,20000))
                        {
                            c.getDH().sendDialogues(750, 57);
                        } else
                        if (!c.getItems().playerHasItems(9075,20))
                        {
                            c.getDH().sendDialogues(751, 57);
                        }
                    }
                } else
                {
                    c.getDH().sendDialogues(752, 57);
                    c.tempRune = 0;
                }
            }

另外,进口目录也是正确的。

为什么没有工作?

问题回答

您的声明描述了三条<代码>int参数:

playerHasItem(int itemID, int amt, int slot)

但是,你要求:

playerHasItems(995,20000)

There is simply no method with two parameters declared.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签