Warning: Can't use blame annotator:
svn blame failed on trunk/src/scriptbuilder/structures/events/TowEvent.java: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator-scriptbuilder/trunk/src/scriptbuilder/structures/events/TowEvent.java @ 36

Revision 36, 1.3 KB checked in by bmcguffin, 9 years ago (diff)

Added toXML implementation for all remaining event classes.

RevLine 
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 */
6package scriptbuilder.structures.events;
7
8import scriptbuilder.structures.ELEMENT;
9import scriptbuilder.structures.I_XML_Writable;
10import scriptbuilder.structures.ScriptEvent;
11
12/**
13 * Data model for a Tow event. A tow truck has a beat and a company, and two
14 * phone numbers: one public, and one for confirmation.
15 *
16 * @author Bryan McGuffin
17 */
18public class TowEvent extends ScriptEvent implements I_XML_Writable
19{
20
21    public TowEvent()
22    {
23        super(ScriptEventType.TOW_EVENT);
24    }
25
26    public String towBeat = "";
27
28    public String towCompany = "";
29
30    public String towConfNum = "";
31
32    public String towPubNum = "";
33
34    @Override
35    public String openTag(String s)
36    {
37        return "<" + s + ">\n";
38    }
39
40    @Override
41    public String closeTag(String s)
42    {
43        return "</" + s + ">\n";
44    }
45
46    @Override
47    public String emptyTag(String s)
48    {
49        return "<" + s + "/>\n";
50    }
51
52    @Override
53    public String toXML()
54    {
55        return emptyTag(ELEMENT.TOW.tag + " Company=\"" + towCompany + "\" ConfNum=\""
56                + towConfNum + "\" PubNum=\"" + towPubNum + "\" Beat=\"" + towBeat + "\"");
57    }
58}
Note: See TracBrowser for help on using the repository browser.