Equipment can have a default position value, e.g. "head" on a helmet--let's call it a slot (like an equipment slot) for this example, although if you can think of a better word I'm all ears.
When it's equipped, if it has a slot, that becomes its position. If it doesn't have one, its position is None.
This would make it display as either helmet (head) or just helmet depending on whether the slot was set.
When it's unequipped, its position is cleared.
This seems pretty straightforward to implement, in any of a couple of ways. Off the top of my head I think my favorite is putting a setter on equipped such that when it's set to False it changes position to None, and when it's set to True it changes position to the current value of slot. That way the position change would follow along with all the ways equipped can change (moving the item etc.) It'd be easy, too, to allow the player to say things like equip duck on head and set the position explicitly while equipping it. (The hard part would actually be parsing it.)
Specifically:
position
value, e.g. "head" on a helmet--let's call it aslot
(like an equipment slot) for this example, although if you can think of a better word I'm all ears.slot
, that becomes itsposition
. If it doesn't have one, itsposition
isNone
.helmet (head)
or justhelmet
depending on whether theslot
was set.position
is cleared.This seems pretty straightforward to implement, in any of a couple of ways. Off the top of my head I think my favorite is putting a setter on
equipped
such that when it's set toFalse
it changesposition
toNone
, and when it's set toTrue
it changesposition
to the current value ofslot
. That way theposition
change would follow along with all the waysequipped
can change (moving the item etc.) It'd be easy, too, to allow the player to say things likeequip duck on head
and set the position explicitly while equipping it. (The hard part would actually be parsing it.)