示例#1
0
 public EditQuestData(QuestData data)
 {
     InitializeComponent();
     foreach( QuestItem item in data.Receive)
     {
         lstItemsWanted.Items.Add(item);
     }
     foreach (QuestItem item in data.Give)
     {
         lstRewards.Items.Add(item);
     }
     txtCompleteMsg.Text = data.Complete;
     txtDisappearMsg.Text = data.Disappear;
 }
示例#2
0
 public QuestData GetQuestData()
 {
     QuestData data = new QuestData();
     data.Complete = txtCompleteMsg.Text;
     data.Disappear = txtDisappearMsg.Text;
     foreach (object obj in lstItemsWanted.Items)
     {
         if (obj is QuestItem)
         {
             data.Receive.Add((QuestItem)obj);
         }
     }
     foreach (object obj in lstRewards.Items)
     {
         if (obj is QuestItem)
         {
             data.Give.Add((QuestItem)obj);
         }
     }
     return data;
 }