選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

CardClicked.java 684 B

12345678910111213141516171819202122232425262728293031
  1. package events;
  2. import com.fasterxml.jackson.databind.JsonNode;
  3. import akka.actor.ActorRef;
  4. import structures.GameState;
  5. /**
  6. * Indicates that the user has clicked an object on the game canvas, in this case a card.
  7. * The event returns the position in the player's hand the card resides within.
  8. *
  9. * {
  10. * messageType = “cardClicked”
  11. * position = <hand index position [1-6]>
  12. * }
  13. *
  14. * @author Dr. Richard McCreadie
  15. *
  16. */
  17. public class CardClicked implements EventProcessor{
  18. @Override
  19. public void processEvent(ActorRef out, GameState gameState, JsonNode message) {
  20. int handPosition = message.get("position").asInt();
  21. }
  22. }