{$MODE OBJFPC} { -*- delphi -*- } {$INCLUDE settings.inc} unit properties; interface type TGravitationalSystemValue = Double; // try Extended if we need more precision PPhysicalProperties = ^TPhysicalProperties; TPhysicalProperties = record ThrustX, ThrustY: TGravitationalSystemValue; class operator Initialize(var Properties: TPhysicalProperties); procedure Reset(); procedure AddTo(Target: PPhysicalProperties); end; implementation class operator TPhysicalProperties.Initialize(var Properties: TPhysicalProperties); begin Properties := Default(TPhysicalProperties); end; procedure TPhysicalProperties.Reset(); begin Self := Default(TPhysicalProperties); end; procedure TPhysicalProperties.AddTo(Target: PPhysicalProperties); begin Target^.ThrustX := Target^.ThrustX + ThrustX; Target^.ThrustY := Target^.ThrustY + ThrustY; end; end.