コード例 #1
0
 /// <summary>
 /// Sets the history of the passed History Book based on the one in the UI
 /// </summary>
 public static void UpdateHistoryBook(MinionHistoryBookSimple book)
 {
     if (simple && selected != NONE)
     {
         //Only add the first element as the selected one
         book.history = new List <ItemModel> {
             new ItemModel(itemModels[selected])
         };
         book.history[0].SummonCount = 1;
     }
     else
     {
         book.history = itemModels.ConvertAll((itemModel) => new ItemModel(itemModel));
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns an "updated" history and removes duplicate entries from the passed history
        /// </summary>
        public static List <ItemModel> MergeHistoryIntoInventory(MinionHistoryBookSimple book)
        {
            List <ItemModel> historyCopy = book.history.ConvertAll(model => new ItemModel(model));

            return(MergeHistoryIntoInventory(historyCopy));
        }