Add Read instances

This commit is contained in:
2022-07-22 01:06:35 +01:00
parent d4e5b02874
commit 4c5218c633
44 changed files with 209 additions and 126 deletions
+25
View File
@@ -0,0 +1,25 @@
module Dodge.Tweak.Show where
import Dodge.Data.Item
showTweak :: TweakParam -> String
showTweak tp = case tt of
TweakPhaseV -> showPhaseV ct
TweakTractionPower -> showTractionPower ct
TweakSpinDrag -> show ct
TweakSpinAmount -> show ct
TweakThrustDelay -> show ct
where
tt = _tweakType tp
ct = _tweakVal tp
showPhaseV :: Int -> String
showPhaseV 0 = "V"
showPhaseV 1 = "/"
showPhaseV 2 = "Z"
showPhaseV i = show i ++ " should not be possible"
showTractionPower :: Int -> String
showTractionPower 0 = "+"
showTractionPower 1 = "-"
showTractionPower 2 = "#"
showTractionPower 3 = "0" -- object should stay in the center of the beam
showTractionPower i = "THIS SHOULD NOT BE POSSIBLE" ++ show i