All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pacman.game.comms.Message Maven / Gradle / Ivy

There is a newer version: 2.0.1.0
Show newest version
package pacman.game.comms;

import pacman.game.Constants.GHOST;

/**
 * Represents a message for the game.
 * 

* Very inflexible - only allowed information will be possible. */ public interface Message { /** * Gets the sender of the message * * @return The sender - any one of the four ghosts */ public GHOST getSender(); /** * Gets the intended recipient of the message *

* If it is null - will be delivered to all ghosts except sender * * @return The recipient of the message */ public GHOST getRecipient(); /** * Gets the message type of the message * * @return The message type */ public MessageType getType(); /** * Gets the data associated with the message * * @return The data */ public int getData(); /** * Gets the tick that the message was created - not all messages arrive the same speed * * @return The tick the message was created */ public int getTick(); public String stringRepresentation(String separator); /** * MessageType - contains information about message delays */ public enum MessageType { PACMAN_SEEN(2), I_AM(1), I_AM_HEADING(1); private int delay; private MessageType(int delay) { this.delay = delay; } public int getDelay() { return delay; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy