예제 #1
0
 /// <summary>
 /// Invokes the corresponding virtual method and event for the given event. Use this instead of invoking
 /// the virtual method and event directly to ensure that the event is invoked correctly.
 /// </summary>
 /// <param name="questDescription">The quest description.</param>
 void InvokeQuestAccepted(IQuestDescription questDescription)
 {
     OnQuestAccepted(questDescription);
     var handler = Events[_eventQuestAccepted] as TypedEventHandler<Control, EventArgs<IQuestDescription>>;
     if (handler != null)
         handler(this, EventArgsHelper.Create(questDescription));
 }
 /// <summary>
 /// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/>
 /// is read-only.</exception>
 public void Add(IQuestDescription item)
 {
     if (_questDescriptions.CanGet(item.QuestID.GetRawValue()))
     {
         _questDescriptions[item.QuestID.GetRawValue()] = item;
     }
     else
     {
         _questDescriptions.Insert(item.QuestID.GetRawValue(), item);
     }
 }
예제 #3
0
 /// <summary>
 /// Handles when a quest has been clicked to be accepted.
 /// This is called immediately before <see cref="AvailableQuestsForm.QuestAccepted"/>.
 /// Override this method instead of using an event hook on <see cref="AvailableQuestsForm.QuestAccepted"/> when possible.
 /// </summary>
 /// <param name="questDescription">The quest description.</param>
 protected virtual void OnQuestAccepted(IQuestDescription questDescription)
 {
 }
 /// <summary>
 /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <returns>
 /// true if <paramref name="item"/> was successfully removed from the
 /// <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false. This method also returns false if
 /// <paramref name="item"/> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </returns>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is
 /// read-only.</exception>
 public bool Remove(IQuestDescription item)
 {
     return _questDescriptions.Remove(item);
 }
 /// <summary>
 /// Copies the elements of the <see cref="T:System.Collections.Generic.ICollection`1"/> to an
 /// <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
 /// </summary>
 /// <param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of
 /// the elements copied from <see cref="T:System.Collections.Generic.ICollection`1"/>. The
 /// <see cref="T:System.Array"/> must have zero-based indexing.</param>
 /// <param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
 /// <exception cref="T:System.ArgumentNullException"><paramref name="array"/> is null.</exception>
 /// <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="arrayIndex"/> is less than 0.</exception>
 /// <exception cref="T:System.ArgumentException"><paramref name="array"/> is multidimensional.-or-
 /// <paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.-or-
 /// The number of elements in the source <see cref="T:System.Collections.Generic.ICollection`1"/> is greater than
 /// the available space from <paramref name="arrayIndex"/> to the end of the destination <paramref name="array"/>.-or-
 /// Type T cannot be cast automatically to the type of the destination <paramref name="array"/>.
 /// </exception>
 public void CopyTo(IQuestDescription[] array, int arrayIndex)
 {
     _questDescriptions.CopyTo(array, arrayIndex);
 }
 /// <summary>
 /// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1"/> contains a specific value.
 /// </summary>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <returns>
 /// true if <paramref name="item"/> is found in the <see cref="T:System.Collections.Generic.ICollection`1"/>;
 /// otherwise, false.
 /// </returns>
 public bool Contains(IQuestDescription item)
 {
     return _questDescriptions.Contains(item);
 }
 /// <summary>
 /// Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/>
 /// is read-only.</exception>
 public void Add(IQuestDescription item)
 {
     if (_questDescriptions.CanGet(item.QuestID.GetRawValue()))
         _questDescriptions[item.QuestID.GetRawValue()] = item;
     else
         _questDescriptions.Insert(item.QuestID.GetRawValue(), item);
 }
예제 #8
0
 /// <summary>
 /// Handles when a quest has been clicked to be accepted.
 /// This is called immediately before <see cref="AvailableQuestsForm.QuestAccepted"/>.
 /// Override this method instead of using an event hook on <see cref="AvailableQuestsForm.QuestAccepted"/> when possible.
 /// </summary>
 /// <param name="questDescription">The quest description.</param>
 protected virtual void OnQuestAccepted(IQuestDescription questDescription)
 {
 }
 /// <summary>
 /// Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <returns>
 /// true if <paramref name="item"/> was successfully removed from the
 /// <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, false. This method also returns false if
 /// <paramref name="item"/> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </returns>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is
 /// read-only.</exception>
 public bool Remove(IQuestDescription item)
 {
     return(_questDescriptions.Remove(item));
 }
 /// <summary>
 /// Determines whether the <see cref="T:System.Collections.Generic.ICollection`1"/> contains a specific value.
 /// </summary>
 /// <param name="item">The object to locate in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
 /// <returns>
 /// true if <paramref name="item"/> is found in the <see cref="T:System.Collections.Generic.ICollection`1"/>;
 /// otherwise, false.
 /// </returns>
 public bool Contains(IQuestDescription item)
 {
     return(_questDescriptions.Contains(item));
 }