[RPG] Removing a character from a party
Posted: Sun May 31, 2020 10:13 pm
Thinking out loud on a pattern.
The thing I am working on supports removing (and optionally saving to disk) a character.
If there's just one character in the party then that's easy, decrement the number of characters in the party. No characters will show up as I am using a global for the number of characters in a party.
If the sixth character is removed that is also easy. Decrement number of characters in the party, the sixth one does not show up. (I should blank out the objects and arrays that make up the definition of that character, of course.)
If there are between two and five members... I want the effect of the characters that were "later" in the party "moving up."
So after the character gets removed, if there are two or more characters or four or fewer characters, I'll do things.
Wait, no, that's wrong - the third character could be removed, which means that we have 5 characters. Still gotta move characters around.
The thing I am working on supports removing (and optionally saving to disk) a character.
If there's just one character in the party then that's easy, decrement the number of characters in the party. No characters will show up as I am using a global for the number of characters in a party.
If the sixth character is removed that is also easy. Decrement number of characters in the party, the sixth one does not show up. (I should blank out the objects and arrays that make up the definition of that character, of course.)
If there are between two and five members... I want the effect of the characters that were "later" in the party "moving up."
So after the character gets removed, if there are two or more characters or four or fewer characters, I'll do things.
Wait, no, that's wrong - the third character could be removed, which means that we have 5 characters. Still gotta move characters around.