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

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

Revision 36, 1.2 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 TMT Radio event. A TMT radio transmission has a string
14 * message.
15 *
16 * @author Bryan McGuffin
17 */
18public class TMTRadioEvent extends ScriptEvent implements I_XML_Writable
19{
20
21    public TMTRadioEvent()
22    {
23        super(ScriptEventType.TMT_RADIO_EVENT);
24    }
25
26    public String message = "";
27
28    @Override
29    public String toXML()
30    {
31        String output = openTag(ELEMENT.TMT_RADIO.tag);
32        output += message;
33        output += closeTag(ELEMENT.TMT_RADIO.tag);
34        return output;
35    }
36
37    @Override
38    public String openTag(String s)
39    {
40        return "<" + s + ">\n";
41    }
42
43    @Override
44    public String closeTag(String s)
45    {
46        return "</" + s + ">\n";
47    }
48
49    @Override
50    public String emptyTag(String s)
51    {
52        return "<" + s + "/>\n";
53    }
54}
Note: See TracBrowser for help on using the repository browser.