Refactor shells

This commit is contained in:
2024-12-27 23:04:59 +00:00
parent 9168acf12e
commit 233fe5995c
8 changed files with 44 additions and 55 deletions
+10 -7
View File
@@ -9,16 +9,19 @@ import Geometry
import Picture
import Shape
import ShapePicture
import Control.Lens
drawProjectile :: Projectile -> SPic
drawProjectile prj = case _prjDraw prj of
DrawShell -> drawShell prj
DrawRemoteShell -> drawRemoteShell prj
DrawDrone -> drawShell prj
DrawBlankProjectile -> mempty
drawProjectile pj
| Just (DestroyPU {}) <- pj ^? prjUpdates . ix 0 = mempty
| Just NoHoming <- pj ^? prjType . rocketHoming =
drawShell Nothing pj
| Just _ <- pj ^? prjType . rocketHoming =
drawRemoteShell pj
| otherwise = drawShell Nothing pj
drawShell :: Projectile -> SPic
drawShell pj =
drawShell :: Maybe Color -> Projectile -> SPic
drawShell mcol pj =
noPic
. translateSHz (_prjZ pj)
. uncurryV translateSHxy (_prjPos pj)