feat: data classes for all events and requests

This commit is contained in:
2021-05-01 22:30:52 +02:00
parent 43cf4c6c1b
commit 3b286b4667
12 changed files with 177 additions and 6 deletions

View File

@ -0,0 +1,15 @@
package uulm.teamname.marvelous.gamelibrary.requests;
import uulm.teamname.marvelous.gamelibrary.IntVector2;
import uulm.teamname.marvelous.gamelibrary.entities.EntityID;
import uulm.teamname.marvelous.gamelibrary.entities.StoneType;
/** Represents a character event for: {@link RequestType#MeleeAttackRequest}, {@link RequestType#RangedAttackRequest}, {@link RequestType#MoveRequest}, {@link RequestType#ExchangeInfinityStoneRequest}, {@link RequestType#UseInfinityStoneRequest}. */
public class CharacterRequest extends Request {
public EntityID originEntity = null;
public EntityID targetEntity = null;
public IntVector2 originField = null;
public IntVector2 targetField = null;
public Integer value = null; //why is it called amount in events and value in requests?
public StoneType stoneType = null;
}

View File

@ -0,0 +1,6 @@
package uulm.teamname.marvelous.gamelibrary.requests;
/** Represents a game request for: {@link RequestType#DisconnectRequest}. */
public class GameRequest extends Request {
}

View File

@ -2,8 +2,7 @@ package uulm.teamname.marvelous.gamelibrary.requests;
import uulm.teamname.marvelous.gamelibrary.json.ingame.MessageStructure;
/** Represents an abstract request sent inside a {@link MessageStructure} between client and server.
*/
/** Represents an abstract request sent inside a {@link MessageStructure} between client and server. */
public abstract class Request {
//TODO: implement Request
public RequestType type;
}

View File

@ -0,0 +1,11 @@
package uulm.teamname.marvelous.gamelibrary.requests;
/** Specifies the type of a {@link Request}. */
public enum RequestType {
MeleeAttackRequest,
RangedAttackRequest,
MoveRequest,
ExchangeInfinityStoneRequest,
UseInfinityStoneRequest,
DisconnectRequest
}