public UTinyList(IRegistry registry, UTinyType.Reference type, IVersionStorage versionStorage = null) : this(registry, versionStorage) { m_Registry = registry; m_Type = type; m_SharedVersionStorage = versionStorage; Refresh(); }
public Installer(DatabaseVersionInstaller databaseVersionInstaller, VersionHandler versionHandler, IVersionStorage versionStorage, InstallerOptions installerOptions, ILogger<Installer> log) { _databaseVersionInstaller = databaseVersionInstaller; _versionHandler = versionHandler; _versionStorage = versionStorage; _installerOptions = installerOptions; _log = log; }
public UTinyProjectSettings(IVersionStorage versionStorage) { VersionStorage = versionStorage; m_DefaultTextureSettings = new UTinyTextureSettings { VersionStorage = versionStorage }; m_DefaultAudioClipSettings = new UTinyAudioClipSettings { VersionStorage = versionStorage }; }
public static void Visit <TContainer, TVisitor>( TContainer container, TVisitor visitor, IVersionStorage versionStorage = null) where TVisitor : IPropertyVisitor { var changeTracker = new ChangeTracker(versionStorage); Visit(ref container, ref visitor, ref changeTracker); }
private static IList MigrateListValue(IRegistry registry, IVersionStorage version, IList value, UTinyType type) { var result = UTinyType.CreateListInstance(type); for (var i = 0; i < value?.Count; i++) { result.Add(UTinyObject.PropertiesContainer.MigrateFieldValue(registry, version, value[i], type, false)); } return(result); }
public UTinyObject(IRegistry registry, UTinyType.Reference type, IVersionStorage versionStorage = null, bool refresh = true) { Registry = registry; m_SharedVersionStorage = versionStorage; m_Properties = new PropertiesContainer(this); m_Type = type; if (refresh) { Refresh(); } }
public UTinyScript(IRegistry registry, IVersionStorage versionStorage) : base(registry, versionStorage) { }
public UTinyModule(IRegistry registry, IVersionStorage versionStorage) : base(registry, versionStorage) { }
public UTinyProject(IRegistry registry, IVersionStorage versionStorage) : base(registry, versionStorage) { m_Settings = new UTinyProjectSettings(this); }
public UTinyDocumentation(IVersionStorage versionStorage) { VersionStorage = versionStorage; }
public UTinySystem(IRegistry registry, IVersionStorage versionStorage) : base(registry, versionStorage) { }
public ChangeTracker(IVersionStorage versionStorage) { VersionStorage = versionStorage; m_Version = 0; }
public static void Transfer <TDestination, TSource>(ref TDestination destination, ref TSource source, IVersionStorage versionStorage = null) { var changeTracker = new ChangeTracker(versionStorage); Transfer(ref destination, ref source, ref changeTracker); }
public static void Transfer <TDestination, TSource>(ref TDestination destination, ref TSource source, IVersionStorage versionStorage = null) { if (!RuntimeTypeInfoCache <TDestination> .IsValueType() && destination == null) { throw new ArgumentNullException(nameof(destination)); } var changeTracker = new ChangeTracker(versionStorage); DoTransfer(ref destination, ref source, ref changeTracker); }
public VersionHandler(InstallerOptions installerOptions, IVersionStorage versionStorage) { _versionStorage = versionStorage; }
public UTinyAsset(IVersionStorage versionStorage) { VersionStorage = versionStorage; }
public UTinyType(IRegistry registry, IVersionStorage versionStorage) : base(registry, versionStorage) { m_Fields = new List <UTinyField>(); m_DefaultValue = new DefaultValueBackingField(); }
public VisitCollectionElementCallback(IPropertyVisitor visitor, IVersionStorage versionStorage) { m_Visitor = visitor; m_ChangeTracker = new ChangeTracker(versionStorage); }
public UTinyList(IRegistry registry, IVersionStorage versionStorage = null) { m_Registry = registry; m_SharedVersionStorage = versionStorage; }
public UTinyField(IVersionStorage versionStorage) { VersionStorage = versionStorage; }
public static void Visit <TContainer, TVisitor>(TContainer container, TVisitor visitor, IVersionStorage versionStorage = null) where TVisitor : IPropertyVisitor { Visit(ref container, visitor, versionStorage); }
public static object MigrateFieldValue(IRegistry registry, IVersionStorage versionStorage, object value, UTinyType type, bool array, object defaultValue = null, bool skipTypeCheck = false) { if (array) { var list = value as UTinyList; if (null == list) { list = new UTinyList(registry, versionStorage) { Type = (UTinyType.Reference)type }; list.Refresh(defaultValue as UTinyList, skipTypeCheck); } else { list.Type = (UTinyType.Reference)type; list.Refresh(defaultValue as UTinyList, skipTypeCheck); } return(list); } switch (type.TypeCode) { case UTinyTypeCode.Unknown: break; case UTinyTypeCode.Int8: return(TryChangeType <sbyte>(value)); case UTinyTypeCode.Int16: return(TryChangeType <short>(value)); case UTinyTypeCode.Int32: return(TryChangeType <int>(value)); case UTinyTypeCode.Int64: return(TryChangeType <long>(value)); case UTinyTypeCode.UInt8: return(TryChangeType <byte>(value)); case UTinyTypeCode.UInt16: return(TryChangeType <ushort>(value)); case UTinyTypeCode.UInt32: return(TryChangeType <uint>(value)); case UTinyTypeCode.UInt64: return(TryChangeType <ulong>(value)); case UTinyTypeCode.Float32: return(TryChangeType <float>(value)); case UTinyTypeCode.Float64: return(TryChangeType <double>(value)); case UTinyTypeCode.Boolean: return(TryChangeType <bool>(value)); case UTinyTypeCode.Char: return(TryChangeType <char>(value)); case UTinyTypeCode.String: return(TryChangeType <string>(value) ?? string.Empty); case UTinyTypeCode.Configuration: case UTinyTypeCode.Component: // Components can not be fields, they can only exist at the entity level throw new NotSupportedException(); case UTinyTypeCode.Struct: { var obj = value as UTinyObject; if (null == obj) { obj = new UTinyObject(registry, (UTinyType.Reference)type, versionStorage, false); obj.Refresh(defaultValue as UTinyObject, skipTypeCheck); } else { obj.Type = (UTinyType.Reference)type; obj.Refresh(defaultValue as UTinyObject, skipTypeCheck); } return(obj); } case UTinyTypeCode.Enum: { if (value is UTinyEnum.Reference) { return(new UTinyEnum.Reference(type, ((UTinyEnum.Reference)value).Id)); } return(defaultValue is UTinyEnum.Reference ? new UTinyEnum.Reference(type, ((UTinyEnum.Reference)defaultValue).Id) : new UTinyEnum.Reference(type, type.Fields.First().Id)); } case UTinyTypeCode.EntityReference: { if (value is UTinyEntity.Reference) { return(value); } return(defaultValue is UTinyEntity.Reference ? defaultValue : UTinyEntity.Reference.None); } case UTinyTypeCode.UnityObject: { if (value is Object) { return(value); } return(defaultValue is Object ? defaultValue : null); } default: throw new ArgumentOutOfRangeException(); } return(null); }
public static VisitResult Transfer <TDstContainer, TSrcContainer>(ref TDstContainer dstContainer, ref TSrcContainer srcContainer, IVersionStorage versionStorage) { return(Transfer(ref dstContainer, ref srcContainer)); }
/// <summary> /// Sets the value of the property with the given name for the given container. /// </summary> /// <param name="container">The container whose data will be set.</param> /// <param name="name">The property name to set.</param> /// <param name="value">The value to assign to the property.</param> /// <param name="versionStorage">The version storage to increment if the value is changed.</param> public static void SetValue <TContainer, TValue>(ref TContainer container, string name, TValue value, IVersionStorage versionStorage = null) { var changeTracker = new ChangeTracker(versionStorage); SetValue(ref container, name, value, ref changeTracker); }
public static void Transfer <TDestination, TSource>(TDestination destination, TSource source, IVersionStorage versionStorage = null) where TDestination : class { if (destination == null) { throw new ArgumentNullException(nameof(destination)); } var changeTracker = new ChangeTracker(versionStorage); DoTransfer(ref destination, ref source, ref changeTracker); }
public UTinyEntityGroup(IRegistry registry, IVersionStorage versionStorage) : base(registry, versionStorage) { }
protected UTinyRegistryObjectBase(IRegistry registry, IVersionStorage versionStorage) { Registry = registry; SharedVersionStorage = versionStorage; }