From 34cabba896507f2b6523d6aec344ec1c88e453be Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 11 May 2020 23:03:21 -0400 Subject: Add a very basic, naive auto-move command Add a very basic, naive auto-move command, which just steps the player in a direction until they collide with something, regardless of any surrounding beasties who might want to eat them. There's a lot of other stuff going on here - in order to get this working the way I wanted with a slight (I settled on 50ms) delay between every step in these autocommands while still redrawing in between I had to do all the extra machinery for custom Brick events with a channel, and then at the same time adding the bits for actually executing autocommands in a general fashion (because there will definitely be more!) hit my threshold for size for App.hs which sent me on a big journey to break it up into smaller files -- which seems actually like it was quite successful. Hopefully this will help with compile times too, though App.hs is still pretty slow (maybe more to do here). --- src/Xanthous/Data.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Xanthous/Data.hs') diff --git a/src/Xanthous/Data.hs b/src/Xanthous/Data.hs index ec40b8721122..3cb74bdca9fd 100644 --- a/src/Xanthous/Data.hs +++ b/src/Xanthous/Data.hs @@ -268,7 +268,7 @@ data Direction where DownRight :: Direction Here :: Direction deriving stock (Show, Eq, Ord, Generic) - deriving anyclass (CoArbitrary, Function, NFData) + deriving anyclass (CoArbitrary, Function, NFData, ToJSON, FromJSON, Hashable) deriving Arbitrary via GenericArbitrary Direction instance Opposite Direction where -- cgit 1.4.1