Tweak inventory management

This commit is contained in:
2021-12-01 01:55:20 +00:00
parent 0ed260c9b7
commit b9e4a80a46
12 changed files with 138 additions and 109 deletions
+14
View File
@@ -0,0 +1,14 @@
module Dodge.Inventory.CloseObject where
import Dodge.Data
import Geometry
closeObjPos :: Either FloorItem Button -> Point2
closeObjPos e = case e of
Right x -> _btPos x
Left x -> _flItPos x
closeObjEq :: Either FloorItem Button -> Either FloorItem Button -> Bool
closeObjEq (Right x) (Right y) = _btID x == _btID y
closeObjEq (Left x) (Left y) = _flItID x == _flItID y
closeObjEq _ _ = False