public AddToInventoryService(GameObject gameObject, PickupableItemConfig config, AddToInventoryEventRepository addToInventoryEventRepository, PlayerInventory inventory) { this.gameObject = gameObject; this.config = config ?? throw new ArgumentNullException(nameof(config)); this.addToInventoryEventRepository = addToInventoryEventRepository ?? throw new ArgumentNullException(nameof(addToInventoryEventRepository)); this.inventory = inventory ?? throw new ArgumentNullException(nameof(inventory)); }
public PickupService( PickupEventRepository pickupEventRepository, MovementEventRepository movementEventRepository, AddToInventoryEventRepository addToInventoryEventRepository, Transform player, PlayerConfig config) { this.pickupEventRepository = pickupEventRepository ?? throw new ArgumentNullException(nameof(pickupEventRepository)); this.movementEventRepository = movementEventRepository ?? throw new ArgumentNullException(nameof(movementEventRepository)); this.addToInventoryEventRepository = addToInventoryEventRepository ?? throw new ArgumentNullException(nameof(addToInventoryEventRepository)); this.config = config ?? throw new ArgumentNullException(nameof(config)); this.player = player; }