/** * @param TES5BasicType $scriptType * @throws ConversionException */ public function setNativeType(TES5BasicType $scriptType) { if (!$this->inheritanceAnalyzer->isExtending($scriptType, $this->scriptType->getNativeType())) { throw new ConversionException("Cannot set script type to non-extending type - current native type " . $this->scriptType->getNativeType()->value() . ", new type " . $scriptType->value()); } $this->scriptType->setNativeType($scriptType->getNativeType()); }
public function trackRemoteScript(TES5ScriptHeader $scriptHeader) { $this->trackedScript = $scriptHeader; $ourNativeType = $this->propertyType->getNativeType(); $remoteNativeType = $this->trackedScript->getScriptType()->getNativeType(); /** * Scenario 1 - types are equal or the remote type is higher than ours in which case we do nothing as they have the good type anyway */ if ($ourNativeType == $remoteNativeType || TES5InheritanceGraphAnalyzer::isExtending($remoteNativeType, $ourNativeType)) { return; } elseif (TES5InheritanceGraphAnalyzer::isExtending($ourNativeType, $remoteNativeType)) { $this->trackedScript->setNativeType($ourNativeType); } else { throw new ConversionException("TES5Property::trackRemoteScript() - The definitions of local property type and remote property type have diverged\r\n ( ours: " . $ourNativeType->value() . ", remote: " . $remoteNativeType->value()); } }