mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
Fixed Issue 193
This commit is contained in:
parent
c021a6fdb5
commit
830664b834
8 changed files with 172 additions and 15 deletions
64
Mage.Common/src/mage/view/DeckView.java
Normal file
64
Mage.Common/src/mage/view/DeckView.java
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* 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.view;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.decks.Deck;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
public class DeckView implements Serializable {
|
||||
|
||||
private String name;
|
||||
private CardsView cards;
|
||||
private CardsView sideboard;
|
||||
|
||||
public DeckView(Deck deck) {
|
||||
name = deck.getName();
|
||||
cards = new CardsView(deck.getCards());
|
||||
sideboard = new CardsView(deck.getSideboard());
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public CardsView getCards() {
|
||||
return cards;
|
||||
}
|
||||
|
||||
public CardsView getSideboard() {
|
||||
return sideboard;
|
||||
}
|
||||
}
|
||||
|
|
@ -30,6 +30,8 @@ package mage.view;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.cards.Card;
|
||||
import mage.cards.decks.Deck;
|
||||
|
||||
/**
|
||||
|
|
@ -39,14 +41,14 @@ import mage.cards.decks.Deck;
|
|||
public class TableClientMessage implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Deck deck;
|
||||
private DeckView deck;
|
||||
private UUID tableId;
|
||||
private UUID gameId;
|
||||
private UUID playerId;
|
||||
private int time;
|
||||
|
||||
public TableClientMessage(Deck deck, UUID tableId, int time) {
|
||||
this.deck = deck;
|
||||
this.deck = new DeckView(deck);
|
||||
this.tableId = tableId;
|
||||
this.time = time;
|
||||
}
|
||||
|
|
@ -56,7 +58,7 @@ public class TableClientMessage implements Serializable {
|
|||
this.playerId = playerId;
|
||||
}
|
||||
|
||||
public Deck getDeck() {
|
||||
public DeckView getDeck() {
|
||||
return deck;
|
||||
}
|
||||
|
||||
|
|
@ -75,4 +77,8 @@ public class TableClientMessage implements Serializable {
|
|||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void cleanUp() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue