orderMove :: Int -> [GPS] -> EngineState ()
orderMove uid gs = do
  u <- getOwnUnit uid
  replaceOwnUnit $ u
    & unitWaypoints .~ gs
--    & unitPosture .~ Moving


-- moveUnitQuant :: Unit -> EngineState Distance
-- moveUnitQuant u = do
--   let s <- speedDefault u ^. unitType


-- moveUnit :: Unit -> EngineState ()
-- moveUnit u = do
--   let wps = u ^. unitWaypoints
--   case wps of
--     [] -> return ()
--     _ -> do
--       let s = (speedDefault u ^. unitType) / 4
--           s' = speedApplyCommandControl s (u ^. unitCommandControlStatus)
--           s'' = 

-- moveUnit :: GPS -> Speed -> GPS
-- moveUnit g s = (realPart newcg, imagPart newcg)
--   where cg = (gpsX g) :+ (gpsY g)
--         newcg = cg + s
orderMove :: Int -> [GPS] -> EngineState ()
orderMove uid gs = do
  u <- getOwnUnit uid
  replaceOwnUnit $ u
    & unitWaypoints .~ gs
--    & unitPosture .~ Moving


-- moveUnitQuant :: Unit -> EngineState Distance
-- moveUnitQuant u = do
--   let s <- speedDefault u ^. unitType


-- moveUnit :: Unit -> EngineState ()
-- moveUnit u = do
--   let wps = u ^. unitWaypoints
--   case wps of
--     [] -> return ()
--     _ -> do
--       let s = (speedDefault u ^. unitType) / 4
--           s' = speedApplyCommandControl s (u ^. unitCommandControlStatus)
--           s'' = 

-- moveUnit :: GPS -> Speed -> GPS
-- moveUnit g s = (realPart newcg, imagPart newcg)
--   where cg = (gpsX g) :+ (gpsY g)
--         newcg = cg + s
orderMove uid gs = do
  u <- getOwnUnit uid
  replaceOwnUnit $ u
    & unitWaypoints .~ gs
--    & unitPosture .~ Moving


-- moveUnitQuant :: Unit -> EngineState Distance
-- moveUnitQuant u = do
--   let s <- speedDefault u ^. unitType


-- moveUnit :: Unit -> EngineState ()
-- moveUnit u = do
--   let wps = u ^. unitWaypoints
--   case wps of
--     [] -> return ()
--     _ -> do
--       let s = (speedDefault u ^. unitType) / 4
--           s' = speedApplyCommandControl s (u ^. unitCommandControlStatus)
--           s'' = 

-- moveUnit :: GPS -> Speed -> GPS
-- moveUnit g s = (realPart newcg, imagPart newcg)
--   where cg = (gpsX g) :+ (gpsY g)
--         newcg = cg + s