コード例 #1
0
 void CreateItemsInTheShop(LootTable TableToGenerateItemsFrom)//create item in the shop from a LootTable
 {
     if (TableToGenerateItemsFrom.Items_DropChance.Count > (Rows * Columns))
     {
         List <Item> ItemsList = TableToGenerateItemsFrom.GenerateItemsFromLootTable(Rows * Columns);
         for (int i = 0; i < ItemsList.Count; i++)
         {
             if (ItemsList[i] != null)
             {
                 AddItemToShop(ItemsList[i]);
             }
         }
     }
     else
     {
         for (int i = 0; i < TableToGenerateItemsFrom.Items_DropChance.Count; i++)
         {
             if (TableToGenerateItemsFrom.Items_DropChance[i].TheItem != null)
             {
                 AddItemToShop(TableToGenerateItemsFrom.Items_DropChance[i].TheItem);
             }
         }
     }
 }