using Sandbox;
using System.Collections.Generic;
using System.Linq;

namespace VeloX;

public abstract partial class VeloXBase
{

	public float CombinedLoad { get; protected set; }
	[Property] public List<VeloXWheel> Wheels { get; set; }
	[Property] public TagSet WheelIgnoredTags { get; set; }
	public bool IsOnGround => Wheels.Any( x => x.IsOnGround );

	public List<VeloXWheel> FindWheels() => [.. Components.GetAll<VeloXWheel>()];

	[Button]
	public void SetupWheels()
	{
		Wheels = FindWheels();
	}
}
