private Optional<Function<LayeredMap,Consumer<PcState>>> useAction;
listen, my java code is immaculate.
(the joke here is that in haskell this would just be
Maybe (LayeredMap -> PcState -> ())
. tho that's not a useful type signature to have in haskell, so actually it'd be something different)actually as a general trend what i've found really useful for writing in javascript or java or whatever is thinking "okay, how would i do this in haskell?", because the answer is generally some slightly elaborate but robust and bugfree code. in this case i'm using a Consumer, but in haskell i'd have some kinda state-change monoid for popping up UI or adding/removing items or changing the map or w/e. and since that's precisely the issue i've been struggling with wrt "how do i communicate the potential effects of item actions", well, just do that and that's the problem solved.
in theory. in practice things are generally a bit thornier and more elaborate. but it's a good foundation, probably.