<?php

namespace Franzz\Spot;
use Franzz\Objects\PhpObject;
use \Settings;

abstract class Geo extends PhpObject {
	protected const EXT = '';

	const GEO_FOLDER = 'geo';
	const OPT_SIMPLE = 'simplification';

	protected array $asTracks;
	protected string $sFilePath;

	public function __construct(string $sCodeName) {
		parent::__construct(get_class($this), Settings::DEBUG, PhpObject::MODE_HTML);
		$this->sFilePath = self::getBackEndFilePath($sCodeName);
		$this->asTracks = array();
	}

	//Access from backend
	public static function getBackendFilePath(string $sCodeName) {
		return '../resources/'.self::GEO_FOLDER.'/'.$sCodeName.static::EXT;
	}

	//Access from frontend (/public/geo is a symlink of /resources/geo)
	public static function getFrontendFilePath(string $sCodeName) {
		return self::GEO_FOLDER.'/'.$sCodeName.static::EXT;
	}

	public function getLog() {
		return $this->getCleanMessageStack(PhpObject::NOTICE_TAB);
	}
}