/** * * * <ul> * Structure of stream : Data[size] * <li>idAction [1] * <li>new controller [TestOn] * <li>destination zone [IdZone] * <li>idPosition [int16] * <li>silent [boolean] * </ul> * * @param node the XML action structure * @param out output stream where the card structure will be saved. * @return the amount of written action in the output. * @throws IOException */ public final int buildMdb(XmlParser.Node node, OutputStream out) throws IOException { XmlAction.buildMdb(Actiontype.MOVE_CARD, node, out); TestOn.serialize(out, node.getAttribute("controller")); out.write(XmlTools.getZone(node.getAttribute("destination"))); MToolKit.writeInt16(out, XmlTools.getPosition(node.getAttribute("position"))); out.write("true".equals(node.getAttribute("silent")) ? 1 : 0); return 1; }
/** * * * <ul> * Structure of stream : Data[size] * <li>idEvent [1] * <li>idZone [1] * <li>test [...] * </ul> * * @param node the XML event structure * @param out output stream where the card structure will be saved * @return the amount of written action, so return always ZERO. * @throws IOException */ public final int buildMdb(XmlParser.Node node, OutputStream out) throws IOException { // write the idEvent Event.FACED_UP.write(out); XmlEvent.buildMdbTriggered(node, out); // write the test XmlTest.getTest("test").buildMdb(node.get("test"), out); return 0; }