public UnityEventDetails(ComponentDefinitionRaw.EventDefinitionRaw eventDefinitionRaw) { EventName = Formatting.SnakeCaseToPascalCase(eventDefinitionRaw.Identifier.Name); CamelCaseEventName = Formatting.PascalCaseToCamelCase(EventName); FqnPayloadType = CommonDetailsUtils.GetCapitalisedFqnTypename(eventDefinitionRaw.Type.Type.QualifiedName); EventIndex = eventDefinitionRaw.EventIndex; }
public ContainedType(TypeReference innerType) { switch (innerType.ValueTypeSelector) { case ValueType.Enum: category = ValueType.Enum; FqnType = CommonDetailsUtils.GetCapitalisedFqnTypename(innerType.Enum); primitiveType = null; break; case ValueType.Primitive: category = ValueType.Primitive; FqnType = UnityTypeMappings.SchemaTypeToUnityType[innerType.Primitive]; primitiveType = innerType.Primitive; break; case ValueType.Type: category = ValueType.Type; FqnType = CommonDetailsUtils.GetCapitalisedFqnTypename(innerType.Type); primitiveType = null; break; default: throw new ArgumentOutOfRangeException("Malformed inner type."); } }
// TODO: This can probably be reworked with the inner type concept. public ContainedType(Field.InnerType innerType, DetailsStore store) { if (innerType.Primitive != null) { category = ContainedTypeCategory.Primitive; Type = CommonDetailsUtils.GetCapitalisedFqnTypename(innerType.Primitive); rawType = innerType.Primitive; } else if (innerType.UserType != null) { category = ContainedTypeCategory.UserDefined; Type = CommonDetailsUtils.GetCapitalisedFqnTypename(innerType.UserType.QualifiedName); rawType = innerType.UserType.QualifiedName; } else if (innerType.EnumType != null) { category = ContainedTypeCategory.Enum; Type = CommonDetailsUtils.GetCapitalisedFqnTypename(innerType.EnumType.QualifiedName); rawType = innerType.EnumType.QualifiedName; } else { throw new ArgumentException("Malformed inner type."); } }
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; }