internal UnityCommandDefinition(ComponentDefinitionRaw.CommandDefinitionRaw rawCommandDefinition) { Name = rawCommandDefinition.name; RawRequestType = rawCommandDefinition.requestType; RawResponseType = rawCommandDefinition.responseType; CommandIndex = rawCommandDefinition.commandIndex; }
public UnityCommandDetails(ComponentDefinitionRaw.CommandDefinitionRaw commandDefinitionRaw) { CommandName = Formatting.SnakeCaseToPascalCase(commandDefinitionRaw.Identifier.Name); CamelCaseCommandName = Formatting.PascalCaseToCamelCase(CommandName); FqnRequestType = CommonDetailsUtils.GetCapitalisedFqnTypename(commandDefinitionRaw.RequestType.Type.QualifiedName); FqnResponseType = CommonDetailsUtils.GetCapitalisedFqnTypename(commandDefinitionRaw.ResponseType.Type.QualifiedName); CommandIndex = commandDefinitionRaw.CommandIndex; }
private static ComponentDefinitionRaw.CommandDefinitionRaw GenerateCommandDefinition(string name, TypeReferenceRaw requestType = null, TypeReferenceRaw responseType = null) { var commandDefinitionRaw = new ComponentDefinitionRaw.CommandDefinitionRaw(); commandDefinitionRaw.name = name; commandDefinitionRaw.requestType = requestType; commandDefinitionRaw.responseType = responseType; commandDefinitionRaw.sourceReference = new SourceReferenceRaw() { line = "1", column = "1" }; return(commandDefinitionRaw); }
private static ComponentDefinitionRaw.CommandDefinitionRaw GenerateCommandDefinition() { var commandDefinition = new ComponentDefinitionRaw.CommandDefinitionRaw(); commandDefinition.name = "TestCommand"; commandDefinition.requestType = new TypeReferenceRaw() { builtInType = "int32" }; commandDefinition.responseType = new TypeReferenceRaw() { builtInType = "int32" }; return(commandDefinition); }
internal UnityCommandDefinition(ComponentDefinitionRaw.CommandDefinitionRaw rawCommandDefinition) { Name = rawCommandDefinition.name; RawRequestType = rawCommandDefinition.requestType; RawResponseType = rawCommandDefinition.responseType; if (RawRequestType != null && RawRequestType.IsBuiltInType) { RequestType = new UnityTypeReference(RawRequestType.TypeName, null, null); } if (RawResponseType != null && RawResponseType.IsBuiltInType) { ResponseType = new UnityTypeReference(RawResponseType.TypeName, null, null); } }
public UnrealCommandDetails(ComponentDefinitionRaw.CommandDefinitionRaw commandDefinition, string capitalisedName, string qualifiedOwnerName, string capitalisedOwnerName, IUnrealTypeReference requestTypeReference, IUnrealTypeReference responseTypeReference, UnrealPackageDetails packageDetails) { CapitalisedName = capitalisedName; UnderlyingCommandDefinition = commandDefinition; UnderlyingCapitalisedName = Formatting.SnakeCaseToCapitalisedCamelCase(commandDefinition.name); UnderlyingPackageDetails = packageDetails; QualifiedOwnerName = qualifiedOwnerName; CapitalisedOwnerName = capitalisedOwnerName; UnrealRequestTypeDetails = requestTypeReference; UnrealResponseTypeDetails = responseTypeReference; UnrealCommandDelegateType = string.Format("{0}{1}", responseTypeReference.CapitalisedName, requestTypeReference.CapitalisedName); UnrealCommandDelegateName = string.Format("F{0}Command", CapitalisedName); }