diff options
author | Griffin Smith <root@gws.fyi> | 2020-02-08T22·24-0500 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2020-02-08T22·24-0500 |
commit | 25a1c5ade32ee0dca41b8057f053972e4ab816d7 (patch) | |
tree | 31d252cb624ed7d6e97d542f6689234791896355 /src/Xanthous/Entities/Character.hs | |
parent | 782d3880c8da35b48276a874d396d24ca6dc7004 (diff) |
Factor out an EntityAttributes type
Factor out a new EntityAttributes type from some of the methods of the Entity class, to avoid the proliferation of 1-argument boolean methods on the entity class that always have to be forwarded through the Entity instance for SomeEntity if they have defaults (forgetting to do which has wasted tons of my time up to this point). Currently blocksVision, blocksObject, and collision are all in there.
Diffstat (limited to 'src/Xanthous/Entities/Character.hs')
-rw-r--r-- | src/Xanthous/Entities/Character.hs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Xanthous/Entities/Character.hs b/src/Xanthous/Entities/Character.hs index 43d4f8a52942..424488828c75 100644 --- a/src/Xanthous/Entities/Character.hs +++ b/src/Xanthous/Entities/Character.hs @@ -84,7 +84,7 @@ instance Draw WieldedItem where draw = draw . view wieldedItem instance Entity WieldedItem where - blocksVision = blocksVision . view wieldedItem + entityAttributes = entityAttributes . view wieldedItem description = description . view wieldedItem entityChar = entityChar . view wieldedItem @@ -232,7 +232,6 @@ instance Brain Character where else hp + hitpointRecoveryRate |*| ticks instance Entity Character where - blocksVision _ = False description _ = "yourself" entityChar _ = "@" |