I have two Models in my card game.
I want to pop a card instance from the HandModel list and place it in the BoardModel coordinates. I would like to send a Card between those two models, but I don't want to directly call BoardModel inside HandModel just for this reason. Not sure how should I do it.
You might want to design your model in a way in which the card model itself has some kind of location which can be updated by a controller which handles the cards. That way no model has to know any other model.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.