package Ġf rc . robot . commands Ċ Ċ import Ġedu . wpi . first . wp ilib j 2 . command . Command Ċ import Ġedu . wpi . first . wp ilib j 2 . command . only When Ċ import Ġedu . wpi . first . wp ilib j 2 . command . repeated ly Ċ import Ġf rc . robot . sub systems . Mag azine Ċ import Ġf rc . robot . sub systems . Sh ooter Ċ import Ġf rc . robot . utils . compareTo Ċ import Ġf rc . robot . utils . diff Ċ import Ġsi . u om . quantity . Angular Speed Ċ import Ġjavax . measure . Quantity Ċ Ċ fun Ġshoot ( ĊĠ Ġmag azine : ĠMag azine , ĊĠ Ġsh ooter : ĠSh ooter , ĊĠ Ġmag azine Speed : Ġ() Ġ-> ĠDouble , ĊĠ Ġshoot Speed : Ġ() Ġ-> ĠQuantity < Angular Speed > ?, ĊĠ Ġtolerance : ĠQuantity < Angular Speed >, ĊĠ Ġback Run Mag azine Time : ĠDouble Ċ ): ĠCommand Ġ{ ĊĠ Ġval Ġcan Shoot Ġ= Ġ{ Ġshoot Speed ()?. let Ġ{ Ġdiff ( it , Ġsh ooter . speed ) Ġ<= Ġtolerance Ġ} Ġ?: Ġfalse Ġ} ĊĠ Ġval Ġback Run Mag azine Ġ= Ġrun Mag azine ( mag azine ) Ġ{ Ġ- mag azine Speed () Ġ}. with Timeout ( back Run Mag azine Time ) ĊĠ Ġreturn Ġrun Sh ooter At Speed ( sh ooter , Ġshoot Speed ). along With ( ĊĠĠĠ Ġrun Mag azine ( mag azine , Ġmag azine Speed ). only When ( can Shoot ). and Then ( back Run Mag azine ). repeated ly () ĊĠ Ġ) Ċ }