public SetOwnershipFactory(TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory, TES5ReferenceFactory referenceFactory, ESMAnalyzer analyzer) { this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.referenceFactory = referenceFactory; this.objectCallFactory = objectCallFactory; this.analyzer = analyzer; }
public TES4ToTES5ASTConverter(ESMAnalyzer ESMAnalyzer, TES5BlockFactory blockFactory, TES5ObjectCallFactory objectCallFactory, TES5ReferenceFactory referenceFactory) { this.esmAnalyzer = ESMAnalyzer; this.blockFactory = blockFactory; this.objectCallFactory = objectCallFactory; this.referenceFactory = referenceFactory; }
public AddTopicFactory(TES5ReferenceFactory referenceFactory, TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory) { this.referenceFactory = referenceFactory; this.objectCallFactory = objectCallFactory; popCalledRenameFunctionFactory = new PopCalledRenameFunctionFactory("Add", referenceFactory, objectCallFactory, objectCallArgumentsFactory); globalVariableFinder = new TES4TopicsToTES5GlobalVariableFinder(); }
public PopCalledRenameFunctionFactory(string newFunctionName, TES5ReferenceFactory referenceFactory, TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory) { this.newFunctionName = newFunctionName; this.referenceFactory = referenceFactory; this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.objectCallFactory = objectCallFactory; }
public MessageBoxFactory(TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory, TES5ReferenceFactory referenceFactory, MetadataLogService metadataLogService) { this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.referenceFactory = referenceFactory; this.metadataLogService = metadataLogService; this.objectCallFactory = objectCallFactory; this.messageBoxData = new MessageBoxData(); }
public static void GenerateINFOAddTopicScripts(ESMAnalyzer esmAnalyzer, BuildTracker buildTracker, IBuildTarget tifBuildTarget) { TES5TypeInferencer typeInferencer = new TES5TypeInferencer(esmAnalyzer); TES5ObjectCallFactory objectCallFactory = new TES5ObjectCallFactory(typeInferencer); TES4TopicsToTES5GlobalVariableFinder globalVariableFinder = new TES4TopicsToTES5GlobalVariableFinder(); TES5GlobalVariables globalVariables = esmAnalyzer.GlobalVariables; var builtTIFs = buildTracker.GetBuiltScripts(BuildTargetFactory.TIFName); foreach (TES4Record infoRecord in esmAnalyzer.GetRecords().Where(r => r.RecordType == TES4RecordType.INFO)) { TES4SubrecordData[] names = infoRecord.GetSubrecords("NAME").ToArray(); if (names.Any()) { string fragment0Name = TES5FragmentFactory.GetFragmentName(0); string nameTES5FormIDHex = (infoRecord.FormID + 0x01000000).ToString("x8"); string scriptName = TES5ReferenceFactory.tif_Prefix + "_" + nameTES5FormIDHex; TES5Script? infoTIF = builtTIFs.Where(s => s.Key == scriptName).Select(s => s.Value.Script).FirstOrDefault(); TES5FunctionCodeBlock fragment0; if (infoTIF != null) { fragment0 = infoTIF.BlockList.Blocks.OfType <TES5FunctionCodeBlock>().Where(b => b.BlockName == fragment0Name).First(); } else { TES5ScriptHeader scriptHeader = TES5ScriptHeaderFactory.GetFromCacheOrConstructByBasicType(scriptName, TES5BasicType.T_TOPICINFO, TES5TypeFactory.TES4_Prefix, true); TES5GlobalScope globalScope = new TES5GlobalScope(scriptHeader); TES5FunctionScope functionScope = new TES5FunctionScope(fragment0Name); functionScope.AddParameter(new TES5SignatureParameter("akSpeakerRef", TES5BasicType.T_OBJECTREFERENCE, true)); TES5LocalScope localScope = new TES5LocalScope(functionScope); TES5CodeScope codeScope = TES5CodeScopeFactory.CreateCodeScope(localScope); fragment0 = new TES5FunctionCodeBlock(functionScope, codeScope, TES5VoidType.Instance, false, true); TES5BlockList blockList = new TES5BlockList() { fragment0 }; infoTIF = new TES5Script(globalScope, blockList, true); string outputPath = tifBuildTarget.GetTranspileToPath(scriptName); TES5Target target = new TES5Target(infoTIF, outputPath); buildTracker.RegisterBuiltScript(tifBuildTarget, target); } foreach (TES4SubrecordData name in names) { int formID = infoRecord.ExpandBytesIntoFormID(name); TES4Record addedTopic = esmAnalyzer.GetRecordByFormID(formID); Tuple <int, string>?globalVariable = globalVariableFinder.GetGlobalVariableNullable(addedTopic.FormID); string globalVariableEditorID = globalVariable != null ? globalVariable.Item2 : globalVariableFinder.GetGlobalVariableEditorID(addedTopic.GetEditorID()); Nullable <int> globalVariableTES5FormID = globalVariable != null ? globalVariable.Item1 : (Nullable <int>)null; TES5Property topicAddedProperty = TES5PropertyFactory.ConstructWithTES5FormID(globalVariableEditorID, TES5BasicType.T_GLOBALVARIABLE, globalVariableEditorID, globalVariableTES5FormID); infoTIF.GlobalScope.AddPropertyIfNotExists(topicAddedProperty); TES5Reference topicAddedReference = TES5ReferenceFactory.CreateReferenceToVariableOrProperty(topicAddedProperty); fragment0.AddChunk(objectCallFactory.CreateObjectCall(topicAddedReference, "SetValueInt", new TES5ObjectCallArguments() { new TES5Integer(1) })); } } } }
public LockFactory(TES5ValueFactory valueFactory, TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory, TES5ReferenceFactory referenceFactory, TES5ObjectPropertyFactory objectPropertyFactory, ESMAnalyzer analyzer, TES5TypeInferencer typeInferencer, MetadataLogService metadataLogService) { this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.valueFactory = valueFactory; this.referenceFactory = referenceFactory; this.analyzer = analyzer; this.objectPropertyFactory = objectPropertyFactory; this.typeInferencer = typeInferencer; this.metadataLogService = metadataLogService; this.objectCallFactory = objectCallFactory; }
public static BuildTarget Get(string target, Build build, BuildLogServices buildLogServices, bool includeQFWriteCommand = true) { switch (target) { case BuildTarget.BUILD_TARGET_STANDALONE: { StandaloneParsingService standaloneParsingService = new StandaloneParsingService(new SyntaxErrorCleanParser(new TES4OBScriptGrammar())); return(new BuildTarget(BuildTarget.BUILD_TARGET_STANDALONE, TES5TypeFactory.TES4Prefix, build, buildLogServices.MetadataLogService, new Standalone.TranspileCommand(standaloneParsingService, build, buildLogServices.MetadataLogService), new Standalone.CompileCommand(), new Standalone.ASTCommand(), new Standalone.BuildScopeCommand(standaloneParsingService), new Standalone.WriteCommand())); } case BuildTarget.BUILD_TARGET_TIF: { FragmentsParsingService fragmentsParsingService = new FragmentsParsingService(new SyntaxErrorCleanParser(new TES4ObscriptCodeGrammar())); return(new BuildTarget(BuildTarget.BUILD_TARGET_TIF, "", build, buildLogServices.MetadataLogService, new TIF.TranspileCommand(fragmentsParsingService, build, buildLogServices.MetadataLogService), new TIF.CompileCommand(), new TIF.ASTCommand(), new TIF.BuildScopeCommand(), new TIF.WriteCommand())); } case BuildTarget.BUILD_TARGET_PF: { return(new BuildTarget(BuildTarget.BUILD_TARGET_PF, "", build, buildLogServices.MetadataLogService, new PF.TranspileCommand(), new PF.CompileCommand(), new PF.ASTCommand(), new PF.BuildScopeCommand(), new PF.WriteCommand())); } case BuildTarget.BUILD_TARGET_QF: { FragmentsParsingService fragmentsParsingService = new FragmentsParsingService(new SyntaxErrorCleanParser(new TES4ObscriptCodeGrammar())); QF.WriteCommand writeCommand; if (includeQFWriteCommand) { //Allows for skipping TES4 file loading when using BuildFileDeleteCommand ESMAnalyzer analyzer = new ESMAnalyzer(DataDirectory.TES4GameFileName); TES5TypeInferencer typeInferencer = new TES5TypeInferencer(analyzer, BuildTarget.StandaloneSourcePath); TES5ObjectCallFactory objectCallFactory = new TES5ObjectCallFactory(typeInferencer); TES5ObjectPropertyFactory objectPropertyFactory = new TES5ObjectPropertyFactory(typeInferencer); TES5ReferenceFactory referenceFactory = new TES5ReferenceFactory(objectCallFactory, objectPropertyFactory); TES5ValueFactory valueFactory = new TES5ValueFactory(objectCallFactory, referenceFactory, objectPropertyFactory, analyzer, typeInferencer, buildLogServices.MetadataLogService); TES5ObjectCallArgumentsFactory objectCallArgumentsFactory = new TES5ObjectCallArgumentsFactory(valueFactory); TES5ValueFactoryFunctionFiller.FillFunctions(valueFactory, objectCallFactory, objectCallArgumentsFactory, referenceFactory, objectPropertyFactory, analyzer, typeInferencer, buildLogServices.MetadataLogService); ObjectiveHandlingFactory objectiveHandlingFactory = new ObjectiveHandlingFactory(referenceFactory); QFFragmentFactory qfFragmentFactory = new QFFragmentFactory(buildLogServices.MappedTargetsLogService, objectiveHandlingFactory); writeCommand = new QF.WriteCommand(qfFragmentFactory); } else { writeCommand = null; } return(new BuildTarget(BuildTarget.BUILD_TARGET_QF, "", build, buildLogServices.MetadataLogService, new QF.TranspileCommand(fragmentsParsingService, build, buildLogServices.MetadataLogService), new QF.CompileCommand(), new QF.ASTCommand(), new QF.BuildScopeCommand(), writeCommand)); } default: { throw new InvalidOperationException("Unknown target " + target); } } }
private static void GetFactories(MetadataLogService metadataLogService, out ESMAnalyzer analyzer, out TES5ObjectCallFactory objectCallFactory, out TES5ReferenceFactory referenceFactory, out TES5ValueFactory valueFactory, out TES5ChainedCodeChunkFactory chainedCodeChunkFactory, out TES5AdditionalBlockChangesPass additionalBlockChangesPass) { analyzer = new ESMAnalyzer(DataDirectory.TES4GameFileName); TES5TypeInferencer typeInferencer = new TES5TypeInferencer(analyzer, BuildTarget.StandaloneSourcePath); TES5ObjectPropertyFactory objectPropertyFactory = new TES5ObjectPropertyFactory(typeInferencer); objectCallFactory = new TES5ObjectCallFactory(typeInferencer); referenceFactory = new TES5ReferenceFactory(objectCallFactory, objectPropertyFactory); valueFactory = new TES5ValueFactory(objectCallFactory, referenceFactory, objectPropertyFactory, analyzer, typeInferencer, metadataLogService); TES5ObjectCallArgumentsFactory objectCallArgumentsFactory = new TES5ObjectCallArgumentsFactory(valueFactory); TES5ValueFactoryFunctionFiller.FillFunctions(valueFactory, objectCallFactory, objectCallArgumentsFactory, referenceFactory, objectPropertyFactory, analyzer, typeInferencer, metadataLogService); TES5VariableAssignationConversionFactory assignationConversionFactory = new TES5VariableAssignationConversionFactory(objectCallFactory, referenceFactory, valueFactory, typeInferencer); TES5ReturnFactory returnFactory = new TES5ReturnFactory(objectCallFactory); chainedCodeChunkFactory = new TES5ChainedCodeChunkFactory(valueFactory, returnFactory, assignationConversionFactory); additionalBlockChangesPass = new TES5AdditionalBlockChangesPass(objectCallFactory, referenceFactory); }
private static void GetFactories(MetadataLogService metadataLogService, ESMAnalyzer esmAnalyzer, out TES5ObjectCallFactory objectCallFactory, out TES5ChainedCodeChunkFactory chainedCodeChunkFactory, out TES5AdditionalBlockChangesPass additionalBlockChangesPass) { TES5TypeInferencer typeInferencer = new TES5TypeInferencer(esmAnalyzer); TES5ObjectPropertyFactory objectPropertyFactory = new TES5ObjectPropertyFactory(typeInferencer); objectCallFactory = new TES5ObjectCallFactory(typeInferencer); TES5ReferenceFactory referenceFactory = new TES5ReferenceFactory(objectCallFactory, objectPropertyFactory, esmAnalyzer); TES5ValueFactory valueFactory = new TES5ValueFactory(objectCallFactory, referenceFactory, esmAnalyzer); TES5ObjectCallArgumentsFactory objectCallArgumentsFactory = new TES5ObjectCallArgumentsFactory(valueFactory); TES5ValueFactoryFunctionFiller.FillFunctions(valueFactory, objectCallFactory, objectCallArgumentsFactory, referenceFactory, objectPropertyFactory, metadataLogService, esmAnalyzer); TES5VariableAssignationConversionFactory assignationConversionFactory = new TES5VariableAssignationConversionFactory(objectCallFactory, referenceFactory, valueFactory, typeInferencer); TES5ReturnFactory returnFactory = new TES5ReturnFactory(objectCallFactory); chainedCodeChunkFactory = new TES5ChainedCodeChunkFactory(valueFactory, returnFactory, assignationConversionFactory); additionalBlockChangesPass = new TES5AdditionalBlockChangesPass(objectCallFactory, referenceFactory); }
public static BuildTargetAdvanced ConstructAdvanced(BuildTargetSimple buildTarget, BuildLogServiceCollection buildLogServices, ESMAnalyzer esmAnalyzer, TES5TypeInferencer typeInferencer) { switch (buildTarget.Name) { case StandaloneName: { StandaloneParsingService standaloneParsingService = new StandaloneParsingService(new SyntaxErrorCleanParser(new TES4OBScriptGrammar())); return(new BuildTargetAdvanced(buildTarget, new Standalone.TranspileCommand(standaloneParsingService, buildLogServices.MetadataLogService, esmAnalyzer), new Standalone.BuildScopeCommand(standaloneParsingService, esmAnalyzer, new TES5PropertyFactory(esmAnalyzer)), new Standalone.WriteCommand())); } case TIFName: { FragmentsParsingService fragmentsParsingService = new FragmentsParsingService(new SyntaxErrorCleanParser(new TES4ObscriptCodeGrammar())); return(new BuildTargetAdvanced(buildTarget, new TIF.TranspileCommand(fragmentsParsingService, buildLogServices.MetadataLogService, esmAnalyzer), new TIF.BuildScopeCommand(new TES5PropertyFactory(esmAnalyzer), new FragmentsReferencesBuilder(esmAnalyzer)), new TIF.WriteCommand())); } case PFName: { return(new BuildTargetAdvanced(buildTarget, new PF.TranspileCommand(), new PF.BuildScopeCommand(), new PF.WriteCommand())); } case QFName: { FragmentsParsingService fragmentsParsingService = new FragmentsParsingService(new SyntaxErrorCleanParser(new TES4ObscriptCodeGrammar())); TES5ObjectCallFactory objectCallFactory = new TES5ObjectCallFactory(typeInferencer); TES5ObjectPropertyFactory objectPropertyFactory = new TES5ObjectPropertyFactory(typeInferencer); TES5ReferenceFactory referenceFactory = new TES5ReferenceFactory(objectCallFactory, objectPropertyFactory, esmAnalyzer); TES5ValueFactory valueFactory = new TES5ValueFactory(objectCallFactory, referenceFactory, esmAnalyzer); TES5ObjectCallArgumentsFactory objectCallArgumentsFactory = new TES5ObjectCallArgumentsFactory(valueFactory); TES5ValueFactoryFunctionFiller.FillFunctions(valueFactory, objectCallFactory, objectCallArgumentsFactory, referenceFactory, objectPropertyFactory, buildLogServices.MetadataLogService, esmAnalyzer); TES5VariableAssignationConversionFactory assignationConversionFactory = new TES5VariableAssignationConversionFactory(objectCallFactory, referenceFactory, valueFactory, typeInferencer); TES5ReturnFactory returnFactory = new TES5ReturnFactory(objectCallFactory); TES5ChainedCodeChunkFactory chainedCodeChunkFactory = new TES5ChainedCodeChunkFactory(valueFactory, returnFactory, assignationConversionFactory); TES5FragmentFactory fragmentFactory = new TES5FragmentFactory(chainedCodeChunkFactory); ObjectiveHandlingFactory objectiveHandlingFactory = new ObjectiveHandlingFactory(objectCallFactory); QFFragmentFactory qfFragmentFactory = new QFFragmentFactory(buildLogServices.MappedTargetsLogService, objectiveHandlingFactory, esmAnalyzer); QF.WriteCommand writeCommand = new QF.WriteCommand(qfFragmentFactory); return(new BuildTargetAdvanced(buildTarget, new QF.TranspileCommand(fragmentsParsingService, fragmentFactory), new QF.BuildScopeCommand(new TES5PropertyFactory(esmAnalyzer), new FragmentsReferencesBuilder(esmAnalyzer)), writeCommand)); } default: { throw new InvalidOperationException("Unknown target " + buildTarget.Name); } } }
public GetIsRaceFactory(TES5ReferenceFactory referenceFactory, TES5ObjectCallFactory objectCallFactory) { this.referenceFactory = referenceFactory; this.objectCallFactory = objectCallFactory; }
public IsSpellTargetFactory(TES5ReferenceFactory referenceFactory, TES5ObjectCallFactory objectCallFactory) { this.referenceFactory = referenceFactory; this.objectCallFactory = objectCallFactory; }
public RenamedFunctionFactory(string newFunctionName, TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory) { this.newFunctionName = newFunctionName; this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.objectCallFactory = objectCallFactory; }
public SetActorAlphaFactory(TES5ValueFactory valueFactory, TES5ObjectCallFactory objectCallFactory) { this.valueFactory = valueFactory; this.objectCallFactory = objectCallFactory; }
public GetArmorRatingFactory(TES5ObjectCallFactory objectCallFactory) { this.objectCallFactory = objectCallFactory; }
public GetBaseActorValueFactory(TES5ObjectCallFactory objectCallFactory, TES5ReferenceFactory referenceFactory) : base(referenceFactory, objectCallFactory) { }
public FunctionFactoryBase(string tes4FunctionName, string tes5FunctionName, TES5ObjectCallFactory objectCallFactory) { TES4FunctionName = tes4FunctionName; TES5FunctionName = tes5FunctionName; this.objectCallFactory = objectCallFactory; }
public TES5AdditionalBlockChangesPass(TES5ObjectCallFactory objectCallFactory, TES5ReferenceFactory referenceFactory) { this.objectCallFactory = objectCallFactory; this.referenceFactory = referenceFactory; }
public ShowMapFactory(TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory, TES5ReferenceFactory referenceFactory) { this.referenceFactory = referenceFactory; this.objectCallFactory = objectCallFactory; this.objectCallArgumentsFactory = objectCallArgumentsFactory; }
public PlayGroupFactory(TES5ObjectCallFactory objectCallFactory) { this.objectCallFactory = objectCallFactory; }
public SetCombatStyleFactory(TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory, LogUnknownFunctionFactory logUnknownFunctionFactory) { this.objectCallFactory = objectCallFactory; this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.logUnknownFunctionFactory = logUnknownFunctionFactory; }
public GetIsCurrentWeatherFactory(TES5ReferenceFactory referenceFactory, TES5ObjectCallFactory objectCallFactory) { this.referenceFactory = referenceFactory; this.objectCallFactory = objectCallFactory; }
public PlayBinkFactory(TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory) { this.objectCallFactory = objectCallFactory; this.objectCallArgumentsFactory = objectCallArgumentsFactory; }
public SetOrForceActorValueFactory(string tes4FunctionName, string tes5FunctionName, TES5ValueFactory valueFactory, TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory, TES5ReferenceFactory referenceFactory, TES5ObjectPropertyFactory objectPropertyFactory, ESMAnalyzer analyzer, TES5TypeInferencer typeInferencer, MetadataLogService metadataLogService) : base(tes4FunctionName, tes5FunctionName, objectCallFactory) { this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.valueFactory = valueFactory; this.referenceFactory = referenceFactory; this.analyzer = analyzer; this.objectPropertyFactory = objectPropertyFactory; this.typeInferencer = typeInferencer; this.metadataLogService = metadataLogService; }
public GetPCMiscStatFactory(TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory) { this.objectCallFactory = objectCallFactory; this.objectCallArgumentsFactory = objectCallArgumentsFactory; }
public SetPCFactionMurderFactory(TES5ValueFactory valueFactory, TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory, TES5ReferenceFactory referenceFactory, TES5ObjectPropertyFactory objectPropertyFactory, ESMAnalyzer analyzer, TES5TypeInferencer typeInferencer, MetadataLogService metadataLogService) : base(valueFactory, objectCallFactory, objectCallArgumentsFactory, referenceFactory, objectPropertyFactory, analyzer, typeInferencer, metadataLogService) { }
public SetPCFameFactory(TES5ValueFactory valueFactory, TES5ObjectCallFactory objectCallFactory, TES5ReferenceFactory referenceFactory) { this.valueFactory = valueFactory; this.referenceFactory = referenceFactory; this.objectCallFactory = objectCallFactory; }
public SetForceSneakFactory(TES5ObjectCallFactory objectCallFactory) { this.objectCallFactory = objectCallFactory; }
public DefaultFunctionFactory(TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory) { this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.objectCallFactory = objectCallFactory; }