/*
 * 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 CAD incident event. CAD events have a string description of
 * what is occurring at that time, and may or may not have sub-events.
 *
 * @author Bryan McGuffin
 */
public class CADEvent extends ScriptEvent implements I_XML_Writable
{

    public CADEvent()
    {
        super(ScriptEventType.CAD_EVENT);
    }

    public boolean hasSubEvents = false;

    public String detail = "";

    @Override
    public String toXML()
    {
        String output = openTag(ELEMENT.DETAIL.tag);
        output += detail;
        output += closeTag(ELEMENT.DETAIL.tag);
        return output;
    }

    @Override
    public String openTag(String s)
    {
        return "<" + s + ">";
    }

    @Override
    public String closeTag(String s)
    {
        return "</" + s + ">\n";
    }

    @Override
    public String emptyTag(String s)
    {
        return "<" + s + "/>\n";
    }

}
