| Revision 203,
1.2 KB
checked in by jdalbey, 6 years ago
(diff) |
|
XMLWriter.java name changed to XMLBuilder. Add pretty printing methods (ticket #237).
|
| Rev | Line | |
|---|
| 1 | /* |
|---|
| 2 | * To change this license header, choose License Headers in Project Properties. |
|---|
| 3 | * To change this template file, choose Tools | Templates |
|---|
| 4 | * and open the template in the editor. |
|---|
| 5 | */ |
|---|
| 6 | package scriptbuilder.structures.events; |
|---|
| 7 | |
|---|
| 8 | import scriptbuilder.structures.ELEMENT; |
|---|
| 9 | import scriptbuilder.structures.I_XML_Writable; |
|---|
| 10 | import scriptbuilder.structures.ScriptEvent; |
|---|
| 11 | import scriptbuilder.structures.XMLBuilder; |
|---|
| 12 | |
|---|
| 13 | /** |
|---|
| 14 | * Data model for a Unit event. A unit has a status and an ID number, can be |
|---|
| 15 | * active, and can be the primary response unit. |
|---|
| 16 | * |
|---|
| 17 | * @author Bryan McGuffin |
|---|
| 18 | */ |
|---|
| 19 | public class UnitEvent extends ScriptEvent implements I_XML_Writable |
|---|
| 20 | { |
|---|
| 21 | |
|---|
| 22 | /** |
|---|
| 23 | * Constructor. |
|---|
| 24 | * //TODO: when created, add a unit to the main units list that is contained within SimulationScript |
|---|
| 25 | */ |
|---|
| 26 | public UnitEvent() |
|---|
| 27 | { |
|---|
| 28 | |
|---|
| 29 | super(ScriptEventType.UNIT_EVENT); |
|---|
| 30 | |
|---|
| 31 | } |
|---|
| 32 | |
|---|
| 33 | public String unitActive = ""; |
|---|
| 34 | |
|---|
| 35 | public String unitPrimary = ""; |
|---|
| 36 | |
|---|
| 37 | public String unitStatus = ""; |
|---|
| 38 | |
|---|
| 39 | public String unitNum = ""; |
|---|
| 40 | @Override |
|---|
| 41 | public String toXML() |
|---|
| 42 | { |
|---|
| 43 | return XMLBuilder.emptyTag(ELEMENT.UNIT.tag+" UnitNum=\""+unitNum+"\" Status=\"" |
|---|
| 44 | +unitStatus+"\" Primary=\""+unitPrimary+"\" Active=\""+unitActive+"\""); |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.