Initial work on Frame Edit

This commit is contained in:
Deon George
2019-07-31 20:19:41 +08:00
parent aa6b2f3244
commit bb031b1b82
7 changed files with 269 additions and 11 deletions

View File

@@ -36,5 +36,30 @@ abstract class Parser
return $this->output;
}
/**
* Return the character at a specific position
*
* @param int $x
* @param int $y
* @return string
*/
public function char(int $x,int $y): string
{
$y += 1;
return (isset($this->frame_content[$y]) AND isset($this->frame_content[$y][$x]))
? $this->frame_content[$y][$x]
: ' ';
}
public function attr(int $x,int $y)
{
$y += 1;
return (isset($this->frame_data[$y]) AND isset($this->frame_data[$y][$x]))
? implode(';',$this->frame_data[$y][$x]).'m'
: '-';
}
abstract protected function parse(int $startline,string $content,int $width): string;
}