<?php

include_once("internal/task_sequencer.php");

// --------------------------------------------
class AnnounceTask {
	protected $metagame = NULL;
	protected $faction_id = 0;
	protected $key = "";
	protected $a = array();
	protected $time = 0.0;

	function __construct($metagame, $time, $faction_id, $key, $a = array()) {
		$this->metagame = $metagame;
		$this->faction_id = $faction_id;
		$this->key = $key;
		$this->a = $a;
		$this->time = $time;
	}

	function start() {
		$this->metagame->send_faction_message_key($this->faction_id, $this->key, $this->a);
	}

	function update($time) {
		$this->time -= $time;
	}

	function has_ended() {
		return $this->time < 0.0;
	}
}

?>