/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package scriptbuilder.structures.events; import scriptbuilder.structures.ELEMENT; import scriptbuilder.structures.I_XML_Writable; import scriptbuilder.structures.ScriptEvent; /** * Data model for a Unit event. A unit has a status and an ID number, can be * active, and can be the primary response unit. * * @author Bryan McGuffin */ public class UnitEvent extends ScriptEvent implements I_XML_Writable { public UnitEvent() { super(ScriptEventType.UNIT_EVENT); } public String unitActive = ""; public String unitPrimary = ""; public String unitStatus = ""; public String unitNum = ""; @Override public String openTag(String s) { return "<" + s + ">"; } @Override public String closeTag(String s) { return "\n"; } @Override public String emptyTag(String s) { return "<" + s + "/>\n"; } @Override public String toXML() { return emptyTag(ELEMENT.UNIT.tag+" UnitNum=\""+unitNum+"\" Status=\"" +unitStatus+"\" Primary=\""+unitPrimary+"\" Active=\""+unitActive+"\""); } }