33 lines
754 B
PHP
33 lines
754 B
PHP
<?php
|
|
|
|
namespace swf2ass\ass;
|
|
|
|
use swf2ass\Constants;
|
|
use swf2ass\StyleRecord;
|
|
|
|
class shadowTag implements ASSStyleTag {
|
|
|
|
/** @var int|float */
|
|
private $depth;
|
|
|
|
public function __construct($depth = 0) {
|
|
$this->depth = $depth;
|
|
}
|
|
|
|
public function transitionStyleRecord(StyleRecord $record): ?shadowTag {
|
|
return self::fromStyleRecord($record);
|
|
}
|
|
|
|
public function encode(): string {
|
|
return "\\shad{$this->depth}";
|
|
}
|
|
|
|
public static function fromStyleRecord(StyleRecord $record): ?shadowTag {
|
|
//TODO?
|
|
return new shadowTag(0);
|
|
}
|
|
|
|
public function equals(ASSTag $tag): bool {
|
|
return $tag instanceof $this and abs($this->depth - $tag->depth) <= Constants::EPSILON;
|
|
}
|
|
} |