net.sf.magicproject.xml.tbs
Class Tbs

java.lang.Object
  extended by net.sf.magicproject.xml.tbs.Tbs
All Implemented Interfaces:
XmlToMDB

public class Tbs
extends java.lang.Object
implements XmlToMDB

This class represents an implementation of the XmlToMDB interface that converts a XML tbs node to its binary form to the given OutputSource.

Since:
0.82, 0.83 damage types are exported
Author:
Fabrice Daugan

Field Summary
static java.util.Stack<java.util.List<XmlParser.Node>> macroActions
          Available node for action of macro.
static java.util.Map<java.lang.String,XmlParser.Node> referencedAbilities
          Available ability references of this TBS
static java.util.Map<java.lang.String,java.util.List<XmlParser.Node>> referencedActions
          Available actions references of this TBS
static java.util.Map<java.lang.String,XmlParser.Node> referencedAttachments
          Available attachments references of this TBS.
static java.util.Set<java.lang.String> referencedNonMacroActions
          Available actions references of this TBS do not accepting macro
static java.util.Set<java.lang.String> referencedNonMacroAttachments
          Available attachments references of this TBS do not accepting macro
static java.util.Map<java.lang.String,XmlParser.Node> referencedTest
          Available test references of this TBS
static boolean resolveReferences
          Are the references must be resolved.
 
Constructor Summary
Tbs()
           
 
Method Summary
 int buildMdb(XmlParser.Node node, java.io.OutputStream out)
          Converts the given tbs XML node to its binary form writing in the given OutputStream.
static void buildMdbPhaseType(XmlParser.Node node, java.io.OutputStream out)
           Structure of stream : Data[size] phase name + '\0' [...]
static void buildMdbTooltipFilter(XmlParser.Node node, java.io.OutputStream out)
           Structure of stream : Data[size] display powerANDtoughness yes=1,no=0 [1] display states yes=1,no=0 [1] display types yes=1,no=0 [1] display colors yes=1,no=0 [1] display properties yes=1,no=0 [1] display damage yes=1,no=0 [1] filter [...]
static java.util.List<XmlParser.Node> peekMacroAction()
          Return the last given action to a macro.
static void popMacroAction()
          Remove the last given action to a macro.
static void pushMacroAction(java.util.List<XmlParser.Node> node)
          Push an action (accepting null) for macro.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

referencedAbilities

public static java.util.Map<java.lang.String,XmlParser.Node> referencedAbilities
Available ability references of this TBS


referencedTest

public static java.util.Map<java.lang.String,XmlParser.Node> referencedTest
Available test references of this TBS


referencedActions

public static java.util.Map<java.lang.String,java.util.List<XmlParser.Node>> referencedActions
Available actions references of this TBS


referencedNonMacroActions

public static java.util.Set<java.lang.String> referencedNonMacroActions
Available actions references of this TBS do not accepting macro


referencedNonMacroAttachments

public static java.util.Set<java.lang.String> referencedNonMacroAttachments
Available attachments references of this TBS do not accepting macro


referencedAttachments

public static java.util.Map<java.lang.String,XmlParser.Node> referencedAttachments
Available attachments references of this TBS.


macroActions

public static java.util.Stack<java.util.List<XmlParser.Node>> macroActions
Available node for action of macro.


resolveReferences

public static boolean resolveReferences
Are the references must be resolved.

Constructor Detail

Tbs

public Tbs()
Method Detail

buildMdb

public final int buildMdb(XmlParser.Node node,
                          java.io.OutputStream out)
                   throws java.io.IOException
Converts the given tbs XML node to its binary form writing in the given OutputStream.

Specified by:
buildMdb in interface XmlToMDB
Parameters:
node - the XML card structure
out - outputstream where the card structure will be saved
Returns:
the amount of written action in the output.
Throws:
java.io.IOException - error during the writting.
See Also:
IdTokens.PLAYER_REGISTER_SIZE, PhaseType, SystemAbility, StatePicture, MdbLoader.loadMDB(String, int)

buildMdbPhaseType

public static final void buildMdbPhaseType(XmlParser.Node node,
                                           java.io.OutputStream out)
                                    throws java.io.IOException

Parameters:
node - the XML phase type structure
out - outputstream where the card structure will be saved
Throws:
java.io.IOException - error during the
See Also:
PhaseType

buildMdbTooltipFilter

public static final void buildMdbTooltipFilter(XmlParser.Node node,
                                               java.io.OutputStream out)
                                        throws java.io.IOException

Parameters:
node - the XML structure
out - outputstream where the card structure will be saved
Throws:
java.io.IOException - error during the writing.

pushMacroAction

public static void pushMacroAction(java.util.List<XmlParser.Node> node)
Push an action (accepting null) for macro.

Parameters:
node - the node to give to the next macro.

peekMacroAction

public static java.util.List<XmlParser.Node> peekMacroAction()
Return the last given action to a macro.

Returns:
the last given action to a macro.

popMacroAction

public static void popMacroAction()
Remove the last given action to a macro.



Copyright © 2003-2007 Magic-Project. All Rights Reserved.