Moved Mage.Common classes from src to src/main/java

This commit is contained in:
magenoxx 2017-04-20 19:05:09 +03:00
parent e9d31aa93c
commit 21eb420c16
102 changed files with 0 additions and 0 deletions

View file

@ -0,0 +1,38 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.interfaces.callback;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public interface CallbackClient {
void processCallback(ClientCallback callback);
}

View file

@ -0,0 +1,94 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.interfaces.callback;
import java.io.Serializable;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ClientCallback implements Serializable {
private UUID objectId;
private Object data;
private ClientCallbackMethod method;
private int messageId;
public ClientCallback() {}
public ClientCallback(ClientCallbackMethod method, UUID objectId, Object data) {
this.method = method;
this.objectId = objectId;
this.data = data;
}
public ClientCallback(ClientCallbackMethod method, UUID objectId) {
this(method, objectId, null);
}
public void clear() {
method = null;
data = null;
}
public UUID getObjectId() {
return objectId;
}
public void setObjectId(UUID objectId) {
this.objectId = objectId;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
public ClientCallbackMethod getMethod() {
return method;
}
public void setMethod(ClientCallbackMethod method) {
this.method = method;
}
public void setMessageId(int messageId) {
this.messageId = messageId;
}
public int getMessageId() {
return messageId;
}
}

View file

@ -0,0 +1,46 @@
package mage.interfaces.callback;
/**
* Created by IGOUDT on 4-4-2017.
*/
public enum ClientCallbackMethod {
CHATMESSAGE("chatMessage"),
TOURNAMENT_INIT("tournamentInit"),
TOURNAMENT_UPDATE("tournamentUpdate"),
TOURNAMENT_OVER("tournamentOver"),
JOINED_TABLE("joinedTable"),
START_DRAFT("startDraft"),
START_TOURNAMENT("startTournament"),
SIDEBOARD("sideboard"),
CONSTRUCT("construct"),
SHOW_USERMESSAGE("showUserMessage"),
WATCHGAME("watchGame"),
REPLAY_GAME("replayGame"),
START_GAME("startGame"),
SHOW_TOURNAMENT("showTournament"),
SHOW_GAME_END_DIALOG("showGameEndDialog"),
SERVER_MESSAGE("serverMessage"),
GAME_INIT("gameInit"),
GAME_OVER("gameOver"),
GAME_INFORM("gameInform"),
GAME_INFORM_PERSONAL("gameInformPersonal"),
GAME_ERROR("gameError"),
GAME_UPDATE("gameUpdate"),
DRAFT_OVER("draftOver"),
REPLAY_DONE("replayDone"),
USER_REQUEST_DIALOG("userRequestDialog"),
REPLAY_UPDATE("replayUpdate"),
REPLAY_INIT("replayInit"),
END_GAME_INFO("endGameInfo"),
GAME_TARGET("gameTarget"),
GAME_CHOOSE_ABILITY("gameChooseAbility"),
GAME_CHOOSE_PILE("gameChoosePile"),
GAME_CHOOSE_CHOICE("gameChooseChoice"), GAME_ASK("gameAsk"), GAME_SELECT("gameSelect"), GAME_PLAY_MANA("gamePlayMana"), GAME_PLAY_XMANA("gamePlayXMana"), GAME_GET_AMOUNT("gameSelectAmount"), DRAFT_INIT("draftInit"), DRAFT_INFORM("draftInform"), DRAFT_PICK("draftPick"), DRAFT_UPDATE("draftUpdate");
String value;
ClientCallbackMethod(String value){
this.value = value;
}
}