public void GenerateAttributes(AInventory <TModuleType> aInventory, AttributeInitializer <TModuleType> attributeInitializer) { foreach (AWeapon <TModuleType> weapon in aInventory.Weapons) { if (null == weapon.fixedAttributes || null == attributeInitializer) { Debug.Log("it shouldn't work"); } else { attributeInitializer.GenerateStuffAttribute(weapon); } } foreach (AClothe <TModuleType> clothe in aInventory.Clothes) { if (null == clothe.fixedAttributes || null == attributeInitializer) { Debug.Log("it shouldn't work"); } else { attributeInitializer.GenerateStuffAttribute(clothe); } } }
public void GenerateConsommable(AInventory <TModuleType> itemContainer, MinMaxf consommableQuantity) { int consommableGet = MathExtension.GenerateRandomIntBetweenFloat(new MinMaxf(consommableQuantity.min * this.lootAttribute.ItemQuantityPercent, consommableQuantity.max * lootAttribute.ItemQuantityPercent)); for (byte i = 0; i < consommableGet; i++) { this.consommableGenerator.GenerateConsommable(itemContainer); } this.ThrowAndClearItemsListIfOnGround(itemContainer); }
public void GenerateItems(AInventory <TModuleType> itemContainer, AttributeInitializer <TModuleType> attributeInitializer, List <AItem <TModuleType> > fixedStuff = null)//rajouter la position du coffre en parametre { this.stuffGenerator.AddFixedItems(itemContainer, fixedStuff); this.stuffGenerator.GenerateRandomItems(itemContainer); if (itemContainer.Items.Count > 0) { this.stuffGenerator.GenerateAttributes(itemContainer, attributeInitializer); } //Debug.Log("I generated " + itemContainer.items.Count + " items") this.ThrowAndClearItemsListIfOnGround(itemContainer); }
private void ThrowAndClearItemsListIfOnGround(AInventory <TModuleType> itemContainer) { if (itemContainer.Items.Count > 0) { if (this.stuffGenerator.InstantiateType == e_itemInstantiateType.OnGround) { foreach (AItem <TModuleType> item in itemContainer.Items) { this.ThrowItem(item); //rajouter une position random a instancier } } if (this.stuffGenerator.InstantiateType == e_itemInstantiateType.OnGround) { itemContainer.Items.Clear(); } } }
public void GenerateStuffAttributes(AInventory <TModuleType> aInventory, AttributeInitializer <TModuleType> attributeInitializer) { this.stuffGenerator.GenerateAttributes(aInventory, attributeInitializer); }