我想在C#+ XNA中创建一个简单的成就类,并且我想实现一个队列,以便在彼此之后快速获得多个成就时,后者将被添加到队列列表。将调用方法的对象添加到列表中
这里是被称为获得一定的成绩方法:
//This is the list that I want to add the achievements to be queued to
static List<Achievement> queueList;
public void GetAchievement()
{
//If the player hasn't got the achievement yet and another achievement is NOT being drawn, get the achievement
if (!got && !drawing)
get = true;
//If the player hasn't got the achievement yet and another achievement IS being drawn, add the achievement to the queue list
else if (!got && drawing)
queueList.Add(); //What do I do here?
}
因此,这将被称为像:exampleAchievement.GetAchievement();例如成就是成就类的一个对象。
我只是不知道如何知道哪个对象调用GetAchievement(),所以我不知道要添加到queueList。
任何帮助将不胜感激!
〜卢卡
编辑: 我用:
queueList.Add(this);
但我只是哑巴,并没有正确地测试它,所以它看上去像什么也没有得到添加到列表中。 感谢您的帮助:3
为什么不总是将成就添加到队列中,即使它只有一个? –