package legends.model.events;

import legends.model.World;
import legends.model.events.basic.Event;
import legends.xml.annotation.Xml;
import legends.xml.annotation.XmlSubtype;

@XmlSubtype("site tribute forced")
public class SiteTributeForcedEvent extends Event {
	@Xml("attacker_civ_id")
	int attackerCivId = -1;
	@Xml("defender_civ_id")
	int defenderCivId = -1;
	@Xml("site_civ_id")
	int siteCivId = -1;
	@Xml("site_id")
	int siteId = -1;

	public int getAttackerCivId() {
		return attackerCivId;
	}

	public void setAttackerCivId(int attackerCivId) {
		this.attackerCivId = attackerCivId;
	}

	public int getDefenderCivId() {
		return defenderCivId;
	}

	public void setDefenderCivId(int defenderCivId) {
		this.defenderCivId = defenderCivId;
	}

	public int getSiteCivId() {
		return siteCivId;
	}

	public void setSiteCivId(int siteCivId) {
		this.siteCivId = siteCivId;
	}

	public int getSiteId() {
		return siteId;
	}

	public void setSiteId(int siteId) {
		this.siteId = siteId;
	}

	@Override
	public String getShortDescription() {
		String attacker = World.getEntity(attackerCivId).getLink();
		String siteCiv = World.getEntity(siteCivId).getLink();
		String site = World.getSite(siteId).getLink();

		return attacker + " secured tribute from " + siteCiv + ", to be delivered from " + site;
	}

}

@@ -434,16 +434,53 @@
 Id = -1;
+%0A%09@Xml(%22season%22)%0A%09String season = %22%22;
 %0A%0A%09publi
@@ -1021,16 +1021,135 @@
 teId;%0A%09%7D
+%0A%09%0A%09public String getSeason() %7B%0A%09%09return season;%0A%09%7D%0A%0A%09public void setSeason(String season) %7B%0A%09%09this.season = season;%0A%09%7D
 %0A%0A%09@Over
@@ -1360,25 +1360,36 @@
 Link();%0A
+%09%09
 %0A%09%09
-return
+String result =
  attacke
@@ -1430,43 +1430,182 @@
 eCiv
- + %22, to be delivered from %22 + site
+;%0A%09%09if (!site.isEmpty()) %7B%0A%09%09%09result = result + %22, to be delivered from %22 + site;%0A%09%09%7D%0A%09%09if (!season.isEmpty()) %7B%0A%09%09%09result = result + %22 every %22 + season;%0A%09%09%7D%0A%0A%09%09return result
 ;%0A%09%7D

Add season to site tribute.