/// <summary>
            /// Called before the menu is exited. We use this function to setup any <see cref="MailInteractionRecord"/> 
            /// data we might need later.
            /// </summary>
            protected override void cleanupBeforeExit()
            {
                switch (mailType)
                {                      
                    case MailType.ItemMail:
                        // Grab all attached items which weren't selected by the player.
                        var unselectedItems = this.itemsToGrab.Where(component => component.item != null).Select(component => component.item).ToList();

                        InteractionRecord = new ItemMailInteractionRecord(this.selectedItems, unselectedItems);
                        break;
                    case MailType.MoneyMail:
                        InteractionRecord = new MoneyMailInteractionRecord(this.MoneyIncluded, this.currency);
                        break;
                    case MailType.RecipeMail:
                        InteractionRecord = new RecipeMailInteractionRecord(this.recipe);
                        break;
                    case MailType.QuestMail:
                        InteractionRecord = new QuestMailInteractionRecord(this.attachedQuestId, this.questAccepted);
                        break;
                    default:
                        InteractionRecord = new MailInteractionRecord();
                        break;
                }

                base.cleanupBeforeExit();
            }
 /// <summary>
 /// Create a new instance of the <see cref="MailClosedCoreEventArgs"/> class.
 /// </summary>
 /// <param name="id">The ID of the mail to be closed.</param>
 /// <param name="arrivalDay">The mail's day of arrival in the receiver's mailbox.</param>
 /// <param name="interactionRecord">Information about how the player interacted with the mail content.</param>
 /// <exception cref="ArgumentNullException">
 /// The specified <paramref name="id"/> is <c>null</c> -or-
 /// the specified <paramref name="arrivalDay"/> is <c>null</c> -or-
 /// the specified <paramref name="interactionRecord"/> is <c>null</c>.
 /// </exception>
 public MailClosedCoreEventArgs(string id, SDate arrivalDay, MailInteractionRecord interactionRecord)
     : base(id, interactionRecord)
 {
     ArrivalDay = arrivalDay ?? throw new ArgumentNullException(nameof(arrivalDay));
 }
Example #3
0
 /// <summary>
 /// Create a new instance of the <see cref="LetterViewerMenuClosedEventArgs"/> class.
 /// </summary>
 /// <param name="mailId">The ID of the mail to be closed.</param>
 /// <param name="selectedItems">Sets the items of the mail which were selected. Can be <c>null</c>.</param>
 /// <exception cref="ArgumentNullException">
 /// The specified <paramref name="mailId"/> is <c>null</c> -or-
 /// the specified <paramref name="interactionRecord"/> is <c>null</c>.
 /// </exception>
 public LetterViewerMenuClosedEventArgs(string mailId, MailInteractionRecord interactionRecord)
 {
     MailId            = mailId ?? throw new ArgumentNullException(nameof(mailId));
     InteractionRecord = interactionRecord ?? throw new ArgumentNullException(nameof(interactionRecord));
 }
Example #4
0
 /// <summary>
 /// Create a new instance of the <see cref="MailClosedEventArgs"/> class.
 /// </summary>
 /// <param name="id">The ID of the mail which was closed.</param>
 /// <param name="interactionRecord">Information about how the player interacted with the mail content.</param>
 /// <exception cref="ArgumentNullException">
 /// The given <paramref name="id"/> is <c>null</c> -or-
 /// the given <paramref name="interactionRecord"/> is <c>null</c>.
 /// </exception>
 public MailClosedEventArgs(string id, MailInteractionRecord interactionRecord)
 {
     Id = id ?? throw new ArgumentNullException(nameof(id));
     InteractionRecord = interactionRecord ?? throw new ArgumentNullException(nameof(interactionRecord));
 }