Interfaces/IPickupItem.cs

Interface for pickup item components on prefabs. Declares Activate(Car owner) which is called when a car uses the item and returns false to veto consumption.

using Machines.Player;

namespace Machines.Items;

/// <summary>
/// Implemented by the root component of a pickup prefab to define what the item does on use.
/// </summary>
public interface IPickupItem
{
	/// <summary>
	/// Activate the item. Return false to veto (inventory keeps it and despawns the prefab).
	/// </summary>
	/// <param name="owner">Car that used the item.</param>
	bool Activate( Car owner );
}