Refactor shells
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user