Commit 7b72c26d authored by Arnaud Guerquin's avatar Arnaud Guerquin

Start split Server/Client event

parent f3c25cb0
......@@ -12,7 +12,7 @@ import java.util.List;
/**
* Created by dupriez on 19/12/15.
*/
public class AbilityEvent implements core.event.Event {
public class AbilityEvent implements ClientEvent,ServerEvent {
private static final long serialVersionUID = 1L;
private int potentialCasterCharacterID;
......
package core.event;
/**
* Only used to add some security between event. Those event can be sent by the server to the client.
* @author Guerquin Arnaud
*
*/
public interface ClientEvent extends Event {
}
......@@ -8,7 +8,7 @@ import core.gamestate.GameContent;
* @author Guerquin Arnaud
*
*/
public class CreationEvent implements Event {
public class CreationEvent implements ClientEvent {
private static final long serialVersionUID = 1L;
......
......@@ -7,7 +7,7 @@ import core.gamestate.GameContent;
* @author Guerquin Arnaud
*
*/
public class DeathEvent implements Event {
public class DeathEvent implements ClientEvent {
private static final long serialVersionUID = 1L;
@Override
......
......@@ -8,7 +8,7 @@ import core.gamestate.GameContent;
* @author Guerquin Arnaud
*
*/
public class EmptyEvent implements Event {
public class EmptyEvent implements ClientEvent,ServerEvent {
private static final long serialVersionUID = 1L;
public static final EmptyEvent empty=new EmptyEvent();
......
......@@ -14,17 +14,6 @@ public interface Event extends NetworkObject{
static final long serialVersionUID = 1L;
public static final int infinity = -1;
/**
* Give a modified version of the first event using the second.
* @param event the event applied to this. Can't be null.
* @return true if a modification happened.
*/
public default boolean alter(Event event){
return false;
}
boolean execute(GameContent gameContent);
......
......@@ -8,7 +8,7 @@ import core.gamestate.GameContent;
* @author Guerquin Arnaud
*
*/
public class FailedEvent implements Event{
public class FailedEvent implements ClientEvent,ServerEvent{
private static final long serialVersionUID = 1L;
static final public Event failed=new FailedEvent();
......
......@@ -11,7 +11,7 @@ import gameloop.DummyLocalGameLoop;
* An Event that changes the map and the gameState
*
*/
public class MapInit implements Event {
public class MapInit implements ClientEvent {
private static final long serialVersionUID = 1L;
private GameContent gameContent;
......
......@@ -12,7 +12,7 @@ import core.zone.Translation;
* @author Guerquin Arnaud
*
*/
public class MoveEvent implements Event {
public class MoveEvent implements ClientEvent,ServerEvent {
private static final long serialVersionUID = 1L;
private int targetID;
......
package core.event;
/**
* Only used to add some security between event. Those event can be sent by the client to the server.
* @author Guerquin Arnaud
*
*/
public interface ServerEvent extends Event {
}
package core.event;
import core.gamestate.GameContent;
import gameloop.GameStarter;
//created by Theodore LOPEZ just for tests on stairs
public class StairsEvent implements Event {
private static final long serialVersionUID = 1L;
public StairsEvent(){
}
@Override
public boolean execute(GameContent gameContent) {
GameStarter.leaveGame();
return true;
}
@Override
public Event resolve(GameContent gameContent) {
return this;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment