Create attractive VASL scenarios, with loads of useful information embedded to assist with game play.
https://vasl-templates.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
package vassal_shim.lfa ;
|
|
|
|
import org.w3c.dom.Document ;
|
|
import org.w3c.dom.Element ;
|
|
|
|
// --------------------------------------------------------------------
|
|
|
|
public class DiceEvent implements Event
|
|
{
|
|
String playerName ;
|
|
String rollType ;
|
|
String rollValues ;
|
|
|
|
public DiceEvent( String playerName, String rollType, String rollValues )
|
|
{
|
|
// initialize the DiceEvent
|
|
this.playerName = playerName ;
|
|
this.rollType = rollType ;
|
|
this.rollValues = rollValues ;
|
|
}
|
|
|
|
public Element makeXmlElement( Document doc )
|
|
{
|
|
// create an XML element for the DiceEvent
|
|
Element elem = doc.createElement( "diceEvent" ) ;
|
|
elem.setAttribute( "player", playerName ) ;
|
|
elem.setAttribute( "rollType", rollType ) ;
|
|
elem.setTextContent( rollValues ) ;
|
|
return elem ;
|
|
}
|
|
|
|
public String toString()
|
|
{
|
|
// return the DiceEvent as a string
|
|
return "<DiceEvent:" + playerName + ":" + rollType + ":" + rollValues + ">" ;
|
|
}
|
|
}
|
|
|