コード例 #1
0
 public void addQuestLogItem(QuestLogItem questLogItem)
 {
     if (!myQuestLogItems.Contains(questLogItem))
     {
         myQuestLogItems.Add(questLogItem);
     }
 }
コード例 #2
0
        //this is a perfect example on how to override the .Equals method
        //that way when we use .contains on an array list of quest log items,
        //it will use this equals method to compare them.
        public override bool Equals(object obj)
        {
            QuestLogItem item = obj as QuestLogItem;

            if (this.Name == item.Name)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
        //adds a quest to the quest log for visual
        public void addQuestLogItem(string questName, string questDetails, Rectangle itemRect)
        {
            QuestLogItem temp = new QuestLogItem(myContentManager, questName, itemRect, questDetails);

            myQuestLogMenu.addQuestLogItem(temp);
        }