Start refactor storing items in single intmap, done turrets
More checks required
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
module Dodge.Machine.Draw (
|
||||
drawMachine,
|
||||
) where
|
||||
module Dodge.Machine.Draw ( drawMachine) where
|
||||
|
||||
import Dodge.Terminal.Color
|
||||
import Control.Lens
|
||||
@@ -18,7 +16,7 @@ drawMachine :: LWorld -> Machine -> SPic
|
||||
drawMachine lw mc = case _mcType mc of
|
||||
McStatic -> mempty
|
||||
McTerminal -> terminalSPic lw mc
|
||||
McTurret tu -> drawBaseMachine 20 mc <> drawTurret tu mc
|
||||
McTurret tu -> drawBaseMachine 20 mc <> drawTurret lw tu mc
|
||||
McSensor se -> drawBaseMachine 25 mc <> drawSensor se mc
|
||||
|
||||
drawSensor :: Sensor -> Machine -> SPic
|
||||
@@ -62,10 +60,10 @@ drawBaseMachine h mc =
|
||||
. square
|
||||
$ _mcWidth mc
|
||||
|
||||
drawTurret :: Turret -> Machine -> SPic
|
||||
drawTurret tu mc = overPosSP (turretItemOffset itm tu mc) (itemSPic itm)
|
||||
where
|
||||
itm = _tuWeapon tu
|
||||
drawTurret :: LWorld -> Turret -> Machine -> SPic
|
||||
drawTurret lw tu mc = fold $ do
|
||||
itm <- lw ^? items . ix (tu ^. tuWeapon)
|
||||
return $ overPosSP (turretItemOffset itm tu mc) (itemSPic itm)
|
||||
|
||||
sensorSPic :: (PaletteColor, DecorationShape) -> Machine -> SPic
|
||||
sensorSPic (pc, ds) mc =
|
||||
|
||||
Reference in New Issue
Block a user