I want to build a multiplayer game over sockjs using the state pattern. I'm not sure if this is the best pattern, but for now I do think so.
The game I want to build is a multi player game. There are 3 different types of players (captain, pirate and guest). Now can a player sometimes have multiple states. For example the state of the pirate can be that it is on the boot and that it has requested to the captain that it wants to go off board. If the captain confirms this. The captain also goes off board together with the pirates who also wants to go off board. The new state is that the captain is off board and the pirates who requested it also are off board. I can't find a way to do this with the state pattern and I also can't find articles who simulate such a scenario. Is this scenario good for the state pattern or is it better to use a different design pattern.
As you can read, the change of the state pattern of the captain also changes the state of some pirates. How to model this?
Aucun commentaire:
Enregistrer un commentaire