Feat: add "Call" command
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
package ch.unibas.dmi.dbis.cs108.casono.server.app.commands.game.call;
|
||||
|
||||
import ch.unibas.dmi.dbis.cs108.casono.server.network.command.execution.CommandHandler;
|
||||
import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.response.OkResponse;
|
||||
import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.response.dispatcher.ResponseDispatcher;
|
||||
|
||||
/**
|
||||
* Minimal handler for CALL: acknowledges the command.
|
||||
*/
|
||||
public class PlayerCallHandler extends CommandHandler<PlayerCallRequest> {
|
||||
|
||||
public PlayerCallHandler(ResponseDispatcher responseDispatcher) {
|
||||
super(responseDispatcher);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(PlayerCallRequest request) {
|
||||
// TODO: integrate with game engine to process call.
|
||||
responseDispatcher.dispatch(new OkResponse(request.getContext()));
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package ch.unibas.dmi.dbis.cs108.casono.server.app.commands.game.call;
|
||||
|
||||
import ch.unibas.dmi.dbis.cs108.casono.server.network.command.parsing.CommandParser;
|
||||
import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.request.PrimitiveRequest;
|
||||
|
||||
/** Parser for the CALL command (no parameters). */
|
||||
public class PlayerCallParser implements CommandParser<PlayerCallRequest> {
|
||||
@Override
|
||||
public PlayerCallRequest parse(PrimitiveRequest primitiveRequest) {
|
||||
return new PlayerCallRequest(primitiveRequest.context());
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package ch.unibas.dmi.dbis.cs108.casono.server.app.commands.game.call;
|
||||
|
||||
import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.request.Request;
|
||||
import ch.unibas.dmi.dbis.cs108.casono.server.network.protocol.request.RequestContext;
|
||||
|
||||
/** Request for CALL command. */
|
||||
public class PlayerCallRequest extends Request {
|
||||
public PlayerCallRequest(RequestContext context) {
|
||||
super(context);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user