Copy Aetheria Code
Added a bunch of code from the old Aetheria project
This commit is contained in:
parent
ab392cd3d6
commit
c58ba0b1da
1704 changed files with 175081 additions and 313 deletions
823
.idea/.idea.Aetheria-Economy/.idea/contentModel.xml
generated
823
.idea/.idea.Aetheria-Economy/.idea/contentModel.xml
generated
|
|
@ -5,193 +5,677 @@
|
|||
<e p="C:\Users\rwvens\.Rider2019.3\system\resharper-host\local\Transient\ReSharperHost\v193\SolutionCaches\_Aetheria-Economy.1697668203.00" t="ExcludeRecursive" />
|
||||
<e p="C:\Users\rwvens\Documents\GitHub\Aetheria-Economy" t="IncludeRecursive">
|
||||
<e p="Aetheria-Economy.sln" t="IncludeFlat" />
|
||||
<e p="Assembly-CSharp-Editor.csproj" t="IncludeRecursive" />
|
||||
<e p="Assembly-CSharp.csproj" t="IncludeRecursive" />
|
||||
<e p="Assets" t="Include">
|
||||
<e p="Scripts" t="Include">
|
||||
<e p="ChatComponent.cs" t="Include" />
|
||||
<e p="ColorButton.cs" t="Include" />
|
||||
<e p="Database.cs" t="Include" />
|
||||
<e p="Extensions.cs" t="Include" />
|
||||
<e p="Galaxy.cs" t="Include" />
|
||||
<e p="Generated" t="Include">
|
||||
<e p="MagicOnion.Generated.cs" t="Include" />
|
||||
<e p="MessagePack.Generated.cs" t="Include" />
|
||||
</e>
|
||||
<e p="InitialSettings.cs" t="Include" />
|
||||
<e p="MagicOnion" t="Include">
|
||||
<e p="AsyncLock.cs" t="Include" />
|
||||
<e p="AsyncStreamReaderExtensions.cs" t="Include" />
|
||||
<e p="Client" t="Include">
|
||||
<e p="ClientFilter.cs" t="Include" />
|
||||
<e p="DynamicClientBuilder.cs" t="Include" />
|
||||
<e p="InterceptInvokeHelper.cs" t="Include" />
|
||||
<e p="MagicOnionClient.cs" t="Include" />
|
||||
<e p="MagicOnionClientBase.cs" t="Include" />
|
||||
<e p="StreamingHubClient.cs" t="Include" />
|
||||
<e p="StreamingHubClientBase.cs" t="Include" />
|
||||
<e p="StreamingHubClientBuilder.cs" t="Include" />
|
||||
<e p="NIH" t="Include">
|
||||
<e p="FastNoise.cs" t="Include" />
|
||||
<e p="LinqFaster" t="Include">
|
||||
<e p="Aggregate.cs" t="Include" />
|
||||
<e p="AnyAll.cs" t="Include" />
|
||||
<e p="Average.cs" t="Include" />
|
||||
<e p="Contains.cs" t="Include" />
|
||||
<e p="Count.cs" t="Include" />
|
||||
<e p="Distinct.cs" t="Include" />
|
||||
<e p="First.cs" t="Include" />
|
||||
<e p="Last.cs" t="Include" />
|
||||
<e p="Max.cs" t="Include" />
|
||||
<e p="Min.cs" t="Include" />
|
||||
<e p="OrderBy.cs" t="Include" />
|
||||
<e p="Range.cs" t="Include" />
|
||||
<e p="readme.txt" t="Include" />
|
||||
<e p="Repeat.cs" t="Include" />
|
||||
<e p="Reverse.cs" t="Include" />
|
||||
<e p="Select.cs" t="Include" />
|
||||
<e p="SelectMany.cs" t="Include" />
|
||||
<e p="SelectWhere.cs" t="Include" />
|
||||
<e p="SequenceEqual.cs" t="Include" />
|
||||
<e p="Single.cs" t="Include" />
|
||||
<e p="Skip.cs" t="Include" />
|
||||
<e p="Sum.cs" t="Include" />
|
||||
<e p="Take.cs" t="Include" />
|
||||
<e p="Utils" t="Include">
|
||||
<e p="ComparerMagic.cs" t="Include" />
|
||||
<e p="CustomPartition.cs" t="Include" />
|
||||
<e p="Error.cs" t="Include" />
|
||||
<e p="GenericOperators.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Where.cs" t="Include" />
|
||||
<e p="WhereAggregate.cs" t="Include" />
|
||||
<e p="WhereSelect.cs" t="Include" />
|
||||
<e p="WhereSum.cs" t="Include" />
|
||||
<e p="Zip.cs" t="Include" />
|
||||
</e>
|
||||
<e p="DynamicArgumentTuple.cs" t="Include" />
|
||||
<e p="MagicOnion.asmdef" t="Include" />
|
||||
<e p="MagicOnionMarshallers.cs" t="Include" />
|
||||
<e p="MetadataExtensions.cs" t="Include" />
|
||||
<e p="ReturnStatusException.cs" t="Include" />
|
||||
<e p="Server" t="Include">
|
||||
<e p="Hubs" t="Include">
|
||||
<e p="BroadcasterHelper.cs" t="Include" />
|
||||
<e p="MagicOnion" t="Include">
|
||||
<e p="AsyncLock.cs" t="Include" />
|
||||
<e p="AsyncStreamReaderExtensions.cs" t="Include" />
|
||||
<e p="Client" t="Include">
|
||||
<e p="ClientFilter.cs" t="Include" />
|
||||
<e p="DynamicClientBuilder.cs" t="Include" />
|
||||
<e p="InterceptInvokeHelper.cs" t="Include" />
|
||||
<e p="MagicOnionClient.cs" t="Include" />
|
||||
<e p="MagicOnionClientBase.cs" t="Include" />
|
||||
<e p="StreamingHubClient.cs" t="Include" />
|
||||
<e p="StreamingHubClientBase.cs" t="Include" />
|
||||
<e p="StreamingHubClientBuilder.cs" t="Include" />
|
||||
</e>
|
||||
<e p="DynamicArgumentTuple.cs" t="Include" />
|
||||
<e p="MagicOnion.asmdef" t="Include" />
|
||||
<e p="MagicOnionMarshallers.cs" t="Include" />
|
||||
<e p="MetadataExtensions.cs" t="Include" />
|
||||
<e p="ReturnStatusException.cs" t="Include" />
|
||||
<e p="Server" t="Include">
|
||||
<e p="Hubs" t="Include">
|
||||
<e p="BroadcasterHelper.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="UnsafeDirectBlitResolver.cs" t="Include" />
|
||||
<e p="Utils" t="Include">
|
||||
<e p="ArrayPoolBufferWriter.cs" t="Include" />
|
||||
<e p="AsyncLocalShim.cs" t="Include" />
|
||||
<e p="DynamicAssembly.cs" t="Include" />
|
||||
<e p="FNV1A32.cs" t="Include" />
|
||||
<e p="ILGeneratorExtensions.cs" t="Include" />
|
||||
<e p="ReflectionExtensions.cs" t="Include" />
|
||||
<e p="ReservedWhenAllPromise.cs" t="Include" />
|
||||
<e p="TaskCompletionSourceEx.cs" t="Include" />
|
||||
<e p="TaskEx.cs" t="Include" />
|
||||
<e p="UniqueHashDictionary.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="UnsafeDirectBlitResolver.cs" t="Include" />
|
||||
<e p="Utils" t="Include">
|
||||
<e p="ArrayPoolBufferWriter.cs" t="Include" />
|
||||
<e p="AsyncLocalShim.cs" t="Include" />
|
||||
<e p="DynamicAssembly.cs" t="Include" />
|
||||
<e p="FNV1A32.cs" t="Include" />
|
||||
<e p="ILGeneratorExtensions.cs" t="Include" />
|
||||
<e p="ReflectionExtensions.cs" t="Include" />
|
||||
<e p="ReservedWhenAllPromise.cs" t="Include" />
|
||||
<e p="TaskCompletionSourceEx.cs" t="Include" />
|
||||
<e p="TaskEx.cs" t="Include" />
|
||||
<e p="UniqueHashDictionary.cs" t="Include" />
|
||||
<e p="MagicOnion.Abstractions" t="Include">
|
||||
<e p="Client" t="Include">
|
||||
<e p="IResponseContext.cs" t="Include" />
|
||||
</e>
|
||||
<e p="ClientStreamingResult.cs" t="Include" />
|
||||
<e p="CompilerServices" t="Include">
|
||||
<e p="AsyncUnaryResultMethodBuilder.cs" t="Include" />
|
||||
</e>
|
||||
<e p="DuplexStreamingResult.cs" t="Include" />
|
||||
<e p="GenerateDefineDebugAttribute.cs" t="Include" />
|
||||
<e p="IgnoreAttribute.cs" t="Include" />
|
||||
<e p="IService.cs" t="Include" />
|
||||
<e p="IStreamingHub.cs" t="Include" />
|
||||
<e p="MagicOnion.Abstractions.asmdef" t="Include" />
|
||||
<e p="Server" t="Include">
|
||||
<e p="Hubs" t="Include">
|
||||
<e p="MethodIdAttribute.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="ServerStreamingResult.cs" t="Include" />
|
||||
<e p="UnaryResult.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="MagicOnion.Abstractions" t="Include">
|
||||
<e p="Client" t="Include">
|
||||
<e p="IResponseContext.cs" t="Include" />
|
||||
<e p="MagicOnion.Unity" t="Include">
|
||||
<e p="ChannelExtensions.cs" t="Include" />
|
||||
<e p="MagicOnion.Unity.asmdef" t="Include" />
|
||||
<e p="UnityDebugLogger.cs" t="Include" />
|
||||
</e>
|
||||
<e p="ClientStreamingResult.cs" t="Include" />
|
||||
<e p="CompilerServices" t="Include">
|
||||
<e p="AsyncUnaryResultMethodBuilder.cs" t="Include" />
|
||||
<e p="MessagePack" t="Include">
|
||||
<e p="Annotations" t="Include">
|
||||
<e p="Attributes.cs" t="Include" />
|
||||
<e p="IMessagePackSerializationCallbackReceiver.cs" t="Include" />
|
||||
</e>
|
||||
<e p="BitOperations.cs" t="Include" />
|
||||
<e p="BufferWriter.cs" t="Include" />
|
||||
<e p="ExtensionHeader.cs" t="Include" />
|
||||
<e p="ExtensionResult.cs" t="Include" />
|
||||
<e p="Formatters" t="Include">
|
||||
<e p="CollectionFormatter.cs" t="Include" />
|
||||
<e p="CollectionHelpers`2.cs" t="Include" />
|
||||
<e p="DateTimeFormatters.cs" t="Include" />
|
||||
<e p="DictionaryFormatter.cs" t="Include" />
|
||||
<e p="DynamicObjectTypeFallbackFormatter.cs" t="Include" />
|
||||
<e p="EnumAsStringFormatter`1.cs" t="Include" />
|
||||
<e p="GenericEnumFormatter`1.cs" t="Include" />
|
||||
<e p="IgnoreFormatter`1.cs" t="Include" />
|
||||
<e p="IMessagePackFormatter`1.cs" t="Include" />
|
||||
<e p="MultiDimensionalArrayFormatter.cs" t="Include" />
|
||||
<e p="NilFormatter.cs" t="Include" />
|
||||
<e p="NullableFormatter.cs" t="Include" />
|
||||
<e p="PrimitiveObjectFormatter.cs" t="Include" />
|
||||
<e p="StandardClassLibraryFormatter.cs" t="Include" />
|
||||
<e p="TypelessFormatter.cs" t="Include" />
|
||||
<e p="UnsafeBinaryFormatters.cs" t="Include" />
|
||||
</e>
|
||||
<e p="HashCode.cs" t="Include" />
|
||||
<e p="IFormatterResolver.cs" t="Include" />
|
||||
<e p="Internal" t="Include">
|
||||
<e p="AsymmetricKeyHashTable.cs" t="Include" />
|
||||
<e p="AutomataDictionary.cs" t="Include" />
|
||||
<e p="ByteArrayStringHashTable.cs" t="Include" />
|
||||
<e p="CodeGenHelpers.cs" t="Include" />
|
||||
<e p="DateTimeConstants.cs" t="Include" />
|
||||
<e p="DynamicAssembly.cs" t="Include" />
|
||||
<e p="ExpressionUtility.cs" t="Include" />
|
||||
<e p="FarmHash.cs" t="Include" />
|
||||
<e p="GuidBits.cs" t="Include" />
|
||||
<e p="ILGeneratorExtensions.cs" t="Include" />
|
||||
<e p="ReflectionExtensions.cs" t="Include" />
|
||||
<e p="Sequence`1.cs" t="Include" />
|
||||
<e p="ThreadsafeTypeKeyHashTable.cs" t="Include" />
|
||||
<e p="TinyJsonReader.cs" t="Include" />
|
||||
<e p="UnsafeMemory.Low.cs" t="Include" />
|
||||
</e>
|
||||
<e p="LZ4" t="Include">
|
||||
<e p="LZ4Codec.cs" t="Include" />
|
||||
<e p="LZ4Codec.Helper.cs" t="Include" />
|
||||
<e p="LZ4Codec.Safe.cs" t="Include" />
|
||||
<e p="LZ4Codec.Safe32.Dirty.cs" t="Include" />
|
||||
<e p="LZ4Codec.Safe64.Dirty.cs" t="Include" />
|
||||
<e p="LZ4Codec.Unsafe.cs" t="Include" />
|
||||
<e p="LZ4Codec.Unsafe32.Dirty.cs" t="Include" />
|
||||
<e p="LZ4Codec.Unsafe64.Dirty.cs" t="Include" />
|
||||
</e>
|
||||
<e p="MessagePack.asmdef" t="Include" />
|
||||
<e p="MessagePackCode.cs" t="Include" />
|
||||
<e p="MessagePackCompression.cs" t="Include" />
|
||||
<e p="MessagePackReader.cs" t="Include" />
|
||||
<e p="MessagePackSecurity.cs" t="Include" />
|
||||
<e p="MessagePackSerializationException.cs" t="Include" />
|
||||
<e p="MessagePackSerializer.cs" t="Include" />
|
||||
<e p="MessagePackSerializer.Json.cs" t="Include" />
|
||||
<e p="MessagePackSerializer.NonGeneric.cs" t="Include" />
|
||||
<e p="MessagePackSerializerOptions.cs" t="Include" />
|
||||
<e p="MessagePackStreamReader.cs" t="Include" />
|
||||
<e p="MessagePackWriter.cs" t="Include" />
|
||||
<e p="Nil.cs" t="Include" />
|
||||
<e p="Resolvers" t="Include">
|
||||
<e p="AttributeFormatterResolver.cs" t="Include" />
|
||||
<e p="BuiltinResolver.cs" t="Include" />
|
||||
<e p="CachingFormatterResolver.cs" t="Include" />
|
||||
<e p="CompositeResolver.cs" t="Include" />
|
||||
<e p="ContractlessReflectionObjectResolver.cs" t="Include" />
|
||||
<e p="DynamicEnumAsStringResolver.cs" t="Include" />
|
||||
<e p="DynamicEnumResolver.cs" t="Include" />
|
||||
<e p="DynamicGenericResolver.cs" t="Include" />
|
||||
<e p="DynamicObjectResolver.cs" t="Include" />
|
||||
<e p="DynamicUnionResolver.cs" t="Include" />
|
||||
<e p="NativeDateTimeResolver.cs" t="Include" />
|
||||
<e p="NativeDecimalResolver.cs" t="Include" />
|
||||
<e p="NativeGuidResolver.cs" t="Include" />
|
||||
<e p="PrimitiveObjectResolver.cs" t="Include" />
|
||||
<e p="StandardResolver.cs" t="Include" />
|
||||
<e p="StaticCompositeResolver.cs" t="Include" />
|
||||
<e p="TypelessContractlessStandardResolver.cs" t="Include" />
|
||||
<e p="TypelessObjectResolver.cs" t="Include" />
|
||||
</e>
|
||||
<e p="SequencePool.cs" t="Include" />
|
||||
<e p="SequenceReader.cs" t="Include" />
|
||||
<e p="SequenceReaderExtensions.cs" t="Include" />
|
||||
<e p="StreamPolyfillExtensions.cs" t="Include" />
|
||||
<e p="StringEncoding.cs" t="Include" />
|
||||
<e p="T4" t="Include">
|
||||
<e p="ForceSizePrimitiveFormatter.cs" t="Include" />
|
||||
<e p="MessagePackReader.Integers.cs" t="Include" />
|
||||
<e p="PrimitiveFormatter.cs" t="Include" />
|
||||
<e p="TupleFormatter.cs" t="Include" />
|
||||
<e p="UnsafeMemory.cs" t="Include" />
|
||||
<e p="ValueTupleFormatter.cs" t="Include" />
|
||||
</e>
|
||||
<e p="ThisLibraryExtensionTypeCodes.cs" t="Include" />
|
||||
<e p="Unity" t="Include">
|
||||
<e p="Extension" t="Include">
|
||||
<e p="UnityBlitResolver.cs" t="Include" />
|
||||
<e p="UnsafeBlitFormatter.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Formatters.cs" t="Include" />
|
||||
<e p="MessagePackWindow.cs" t="Include" />
|
||||
<e p="UnityResolver.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Utilities.cs" t="Include" />
|
||||
</e>
|
||||
<e p="DuplexStreamingResult.cs" t="Include" />
|
||||
<e p="GenerateDefineDebugAttribute.cs" t="Include" />
|
||||
<e p="IgnoreAttribute.cs" t="Include" />
|
||||
<e p="IService.cs" t="Include" />
|
||||
<e p="IStreamingHub.cs" t="Include" />
|
||||
<e p="MagicOnion.Abstractions.asmdef" t="Include" />
|
||||
<e p="Server" t="Include">
|
||||
<e p="Hubs" t="Include">
|
||||
<e p="MethodIdAttribute.cs" t="Include" />
|
||||
<e p="MIConvexHull" t="Include">
|
||||
<e p="Cell2.cs" t="Include" />
|
||||
<e p="Constants.cs" t="Include" />
|
||||
<e p="ConvexHull" t="Include">
|
||||
<e p="Collections.cs" t="Include" />
|
||||
<e p="ConvexFace.cs" t="Include" />
|
||||
<e p="ConvexHullAlgorithm.Initialize.cs" t="Include" />
|
||||
<e p="ConvexHullAlgorithm.MainLoop.cs" t="Include" />
|
||||
<e p="DataModel.cs" t="Include" />
|
||||
<e p="MathHelper.cs" t="Include" />
|
||||
<e p="ObjectManager.cs" t="Include" />
|
||||
</e>
|
||||
<e p="ConvexHull.cs" t="Include" />
|
||||
<e p="Face3.cs" t="Include" />
|
||||
<e p="IVertex.cs" t="Include" />
|
||||
<e p="Triangulation" t="Include">
|
||||
<e p="DelaunayTrianglationInternal.cs" t="Include" />
|
||||
<e p="DelaunayTriangulation.cs" t="Include" />
|
||||
<e p="TriangulationCell.cs" t="Include" />
|
||||
<e p="VoronoiEdge.cs" t="Include" />
|
||||
<e p="VoronoiMesh.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Triangulation.cs" t="Include" />
|
||||
<e p="Vertex2.cs" t="Include" />
|
||||
<e p="Vertex3.cs" t="Include" />
|
||||
</e>
|
||||
<e p="NaughtyAttributes" t="Include">
|
||||
<e p="Scripts" t="Include">
|
||||
<e p="Core" t="Include">
|
||||
<e p="DrawConditionAttributes" t="Include">
|
||||
<e p="DrawConditionAttribute.cs" t="Include" />
|
||||
<e p="HideIfAttribute.cs" t="Include" />
|
||||
<e p="ShowIfAttribute.cs" t="Include" />
|
||||
</e>
|
||||
<e p="DrawerAttributes" t="Include">
|
||||
<e p="ButtonAttribute.cs" t="Include" />
|
||||
<e p="DrawerAttribute.cs" t="Include" />
|
||||
<e p="DropdownAttribute.cs" t="Include" />
|
||||
<e p="MinMaxSliderAttribute.cs" t="Include" />
|
||||
<e p="ReadOnlyAttribute.cs" t="Include" />
|
||||
<e p="ReorderableListAttribute.cs" t="Include" />
|
||||
<e p="ResizableTextAreaAttribute.cs" t="Include" />
|
||||
<e p="ShowAssetPreviewAttribute.cs" t="Include" />
|
||||
<e p="ShowNativePropertyAttribute.cs" t="Include" />
|
||||
<e p="ShowNonSerializedFieldAttribute.cs" t="Include" />
|
||||
<e p="SliderAttribute.cs" t="Include" />
|
||||
</e>
|
||||
<e p="GroupAttributes" t="Include">
|
||||
<e p="BoxGroupAttribute.cs" t="Include" />
|
||||
<e p="GroupAttribute.cs" t="Include" />
|
||||
</e>
|
||||
<e p="MetaAttributes" t="Include">
|
||||
<e p="BlankSpaceAttribute.cs" t="Include" />
|
||||
<e p="InfoBoxAttribute.cs" t="Include" />
|
||||
<e p="MetaAttribute.cs" t="Include" />
|
||||
<e p="OnValueChangedAttribute.cs" t="Include" />
|
||||
<e p="SectionAttribute.cs" t="Include" />
|
||||
</e>
|
||||
<e p="NaughtyAttribute.cs" t="Include" />
|
||||
<e p="ValidatorAttributes" t="Include">
|
||||
<e p="MaxValueAttribute.cs" t="Include" />
|
||||
<e p="MinValueAttribute.cs" t="Include" />
|
||||
<e p="RequiredAttribute.cs" t="Include" />
|
||||
<e p="ValidateInputAttribute.cs" t="Include" />
|
||||
<e p="ValidatorAttribute.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="Editor" t="Include">
|
||||
<e p="Attributes" t="Include">
|
||||
<e p="BaseAttribute.cs" t="Include" />
|
||||
<e p="FieldDrawerAttribute.cs" t="Include" />
|
||||
<e p="IAttribute.cs" t="Include" />
|
||||
<e p="MethodDrawerAttribute.cs" t="Include" />
|
||||
<e p="NativePropertyDrawerAttribute.cs" t="Include" />
|
||||
<e p="PropertyDrawConditionAttribute.cs" t="Include" />
|
||||
<e p="PropertyDrawerAttribute.cs" t="Include" />
|
||||
<e p="PropertyGrouperAttribute.cs" t="Include" />
|
||||
<e p="PropertyMetaAttribute.cs" t="Include" />
|
||||
<e p="PropertyValidatorAttribute.cs" t="Include" />
|
||||
</e>
|
||||
<e p="CodeGeneration" t="Include">
|
||||
<e p="CodeGenerator.cs" t="Include" />
|
||||
<e p="FieldDrawerDatabase.cs" t="Include" />
|
||||
<e p="MethodDrawerDatabase.cs" t="Include" />
|
||||
<e p="NativePropertyDrawerDatabase.cs" t="Include" />
|
||||
<e p="PropertyDrawConditionDatabase.cs" t="Include" />
|
||||
<e p="PropertyDrawerDatabase.cs" t="Include" />
|
||||
<e p="PropertyGrouperDatabase.cs" t="Include" />
|
||||
<e p="PropertyMetaDatabase.cs" t="Include" />
|
||||
<e p="PropertyValidatorDatabase.cs" t="Include" />
|
||||
<e p="Templates" t="Include">
|
||||
<e p="FieldDrawerDatabaseTemplate.txt" t="Include" />
|
||||
<e p="MethodDrawerDatabaseTemplate.txt" t="Include" />
|
||||
<e p="NativePropertyDrawerDbTemplate.txt" t="Include" />
|
||||
<e p="PropertyDrawConditionDatabaseTemplate.txt" t="Include" />
|
||||
<e p="PropertyDrawerDatabaseTemplate.txt" t="Include" />
|
||||
<e p="PropertyGrouperDatabaseTemplate.txt" t="Include" />
|
||||
<e p="PropertyMetaDatabaseTemplate.txt" t="Include" />
|
||||
<e p="PropertyValidatorDatabaseTemplate.txt" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="Editors" t="Include">
|
||||
<e p="InspectorEditor.cs" t="Include" />
|
||||
</e>
|
||||
<e p="FieldDrawers" t="Include">
|
||||
<e p="FieldDrawer.cs" t="Include" />
|
||||
<e p="ShowNonSerializedFieldFieldDrawer.cs" t="Include" />
|
||||
</e>
|
||||
<e p="MethodDrawers" t="Include">
|
||||
<e p="ButtonMethodDrawer.cs" t="Include" />
|
||||
<e p="MethodDrawer.cs" t="Include" />
|
||||
</e>
|
||||
<e p="NativePropertyDrawers" t="Include">
|
||||
<e p="NativePropertyDrawer.cs" t="Include" />
|
||||
<e p="ShowNativePropertyNativePropertyDrawer.cs" t="Include" />
|
||||
</e>
|
||||
<e p="PropertyDrawConditions" t="Include">
|
||||
<e p="HideIfPropertyDrawCondition.cs" t="Include" />
|
||||
<e p="PropertyDrawCondition.cs" t="Include" />
|
||||
<e p="ShowIfPropertyDrawCondition.cs" t="Include" />
|
||||
</e>
|
||||
<e p="PropertyDrawers" t="Include">
|
||||
<e p="DropdownPropertyDrawer.cs" t="Include" />
|
||||
<e p="MinMaxSliderPropertyDrawer.cs" t="Include" />
|
||||
<e p="PropertyDrawer.cs" t="Include" />
|
||||
<e p="ReadOnlyPropertyDrawer.cs" t="Include" />
|
||||
<e p="ReorderableListPropertyDrawer.cs" t="Include" />
|
||||
<e p="ResizableTextAreaPropertyDrawer.cs" t="Include" />
|
||||
<e p="ShowAssetPreviewPropertyDrawer.cs" t="Include" />
|
||||
<e p="SliderPropertyDrawer.cs" t="Include" />
|
||||
</e>
|
||||
<e p="PropertyGroupers" t="Include">
|
||||
<e p="BoxGroupPropertyGrouper.cs" t="Include" />
|
||||
<e p="PropertyGrouper.cs" t="Include" />
|
||||
</e>
|
||||
<e p="PropertyMetas" t="Include">
|
||||
<e p="BlankSpacePropertyMeta.cs" t="Include" />
|
||||
<e p="InfoBoxPropertyMeta.cs" t="Include" />
|
||||
<e p="OnValueChangedPropertyMeta.cs" t="Include" />
|
||||
<e p="PropertyMeta.cs" t="Include" />
|
||||
<e p="SectionPropertyMeta.cs" t="Include" />
|
||||
</e>
|
||||
<e p="PropertyValidators" t="Include">
|
||||
<e p="MaxValuePropertyValidator.cs" t="Include" />
|
||||
<e p="MinValuePropertyValidator.cs" t="Include" />
|
||||
<e p="PropertyValidator.cs" t="Include" />
|
||||
<e p="RequiredPropertyValidator.cs" t="Include" />
|
||||
<e p="ValidateInputPropertyValidator.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Utility" t="Include">
|
||||
<e p="EditorDrawUtility.cs" t="Include" />
|
||||
<e p="IOUtility.cs" t="Include" />
|
||||
<e p="PropertyUtility.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
</e>
|
||||
</e>
|
||||
<e p="ServerStreamingResult.cs" t="Include" />
|
||||
<e p="UnaryResult.cs" t="Include" />
|
||||
</e>
|
||||
<e p="MagicOnion.Unity" t="Include">
|
||||
<e p="ChannelExtensions.cs" t="Include" />
|
||||
<e p="MagicOnion.Unity.asmdef" t="Include" />
|
||||
<e p="UnityDebugLogger.cs" t="Include" />
|
||||
</e>
|
||||
<e p="MessagePack" t="Include">
|
||||
<e p="Annotations" t="Include">
|
||||
<e p="Attributes.cs" t="Include" />
|
||||
<e p="IMessagePackSerializationCallbackReceiver.cs" t="Include" />
|
||||
</e>
|
||||
<e p="BitOperations.cs" t="Include" />
|
||||
<e p="BufferWriter.cs" t="Include" />
|
||||
<e p="ExtensionHeader.cs" t="Include" />
|
||||
<e p="ExtensionResult.cs" t="Include" />
|
||||
<e p="Formatters" t="Include">
|
||||
<e p="CollectionFormatter.cs" t="Include" />
|
||||
<e p="CollectionHelpers`2.cs" t="Include" />
|
||||
<e p="DateTimeFormatters.cs" t="Include" />
|
||||
<e p="DictionaryFormatter.cs" t="Include" />
|
||||
<e p="DynamicObjectTypeFallbackFormatter.cs" t="Include" />
|
||||
<e p="EnumAsStringFormatter`1.cs" t="Include" />
|
||||
<e p="GenericEnumFormatter`1.cs" t="Include" />
|
||||
<e p="IgnoreFormatter`1.cs" t="Include" />
|
||||
<e p="IMessagePackFormatter`1.cs" t="Include" />
|
||||
<e p="MultiDimensionalArrayFormatter.cs" t="Include" />
|
||||
<e p="NilFormatter.cs" t="Include" />
|
||||
<e p="NullableFormatter.cs" t="Include" />
|
||||
<e p="PrimitiveObjectFormatter.cs" t="Include" />
|
||||
<e p="StandardClassLibraryFormatter.cs" t="Include" />
|
||||
<e p="TypelessFormatter.cs" t="Include" />
|
||||
<e p="UnsafeBinaryFormatters.cs" t="Include" />
|
||||
</e>
|
||||
<e p="HashCode.cs" t="Include" />
|
||||
<e p="IFormatterResolver.cs" t="Include" />
|
||||
<e p="Internal" t="Include">
|
||||
<e p="AsymmetricKeyHashTable.cs" t="Include" />
|
||||
<e p="AutomataDictionary.cs" t="Include" />
|
||||
<e p="ByteArrayStringHashTable.cs" t="Include" />
|
||||
<e p="CodeGenHelpers.cs" t="Include" />
|
||||
<e p="DateTimeConstants.cs" t="Include" />
|
||||
<e p="DynamicAssembly.cs" t="Include" />
|
||||
<e p="ExpressionUtility.cs" t="Include" />
|
||||
<e p="FarmHash.cs" t="Include" />
|
||||
<e p="GuidBits.cs" t="Include" />
|
||||
<e p="ILGeneratorExtensions.cs" t="Include" />
|
||||
<e p="ReflectionExtensions.cs" t="Include" />
|
||||
<e p="Sequence`1.cs" t="Include" />
|
||||
<e p="ThreadsafeTypeKeyHashTable.cs" t="Include" />
|
||||
<e p="TinyJsonReader.cs" t="Include" />
|
||||
<e p="UnsafeMemory.Low.cs" t="Include" />
|
||||
</e>
|
||||
<e p="LZ4" t="Include">
|
||||
<e p="LZ4Codec.cs" t="Include" />
|
||||
<e p="LZ4Codec.Helper.cs" t="Include" />
|
||||
<e p="LZ4Codec.Safe.cs" t="Include" />
|
||||
<e p="LZ4Codec.Safe32.Dirty.cs" t="Include" />
|
||||
<e p="LZ4Codec.Safe64.Dirty.cs" t="Include" />
|
||||
<e p="LZ4Codec.Unsafe.cs" t="Include" />
|
||||
<e p="LZ4Codec.Unsafe32.Dirty.cs" t="Include" />
|
||||
<e p="LZ4Codec.Unsafe64.Dirty.cs" t="Include" />
|
||||
</e>
|
||||
<e p="MessagePack.asmdef" t="Include" />
|
||||
<e p="MessagePackCode.cs" t="Include" />
|
||||
<e p="MessagePackCompression.cs" t="Include" />
|
||||
<e p="MessagePackReader.cs" t="Include" />
|
||||
<e p="MessagePackSecurity.cs" t="Include" />
|
||||
<e p="MessagePackSerializationException.cs" t="Include" />
|
||||
<e p="MessagePackSerializer.cs" t="Include" />
|
||||
<e p="MessagePackSerializer.Json.cs" t="Include" />
|
||||
<e p="MessagePackSerializer.NonGeneric.cs" t="Include" />
|
||||
<e p="MessagePackSerializerOptions.cs" t="Include" />
|
||||
<e p="MessagePackStreamReader.cs" t="Include" />
|
||||
<e p="MessagePackWriter.cs" t="Include" />
|
||||
<e p="Nil.cs" t="Include" />
|
||||
<e p="Resolvers" t="Include">
|
||||
<e p="AttributeFormatterResolver.cs" t="Include" />
|
||||
<e p="BuiltinResolver.cs" t="Include" />
|
||||
<e p="CachingFormatterResolver.cs" t="Include" />
|
||||
<e p="CompositeResolver.cs" t="Include" />
|
||||
<e p="ContractlessReflectionObjectResolver.cs" t="Include" />
|
||||
<e p="DynamicEnumAsStringResolver.cs" t="Include" />
|
||||
<e p="DynamicEnumResolver.cs" t="Include" />
|
||||
<e p="DynamicGenericResolver.cs" t="Include" />
|
||||
<e p="DynamicObjectResolver.cs" t="Include" />
|
||||
<e p="DynamicUnionResolver.cs" t="Include" />
|
||||
<e p="NativeDateTimeResolver.cs" t="Include" />
|
||||
<e p="NativeDecimalResolver.cs" t="Include" />
|
||||
<e p="NativeGuidResolver.cs" t="Include" />
|
||||
<e p="PrimitiveObjectResolver.cs" t="Include" />
|
||||
<e p="StandardResolver.cs" t="Include" />
|
||||
<e p="StaticCompositeResolver.cs" t="Include" />
|
||||
<e p="TypelessContractlessStandardResolver.cs" t="Include" />
|
||||
<e p="TypelessObjectResolver.cs" t="Include" />
|
||||
</e>
|
||||
<e p="SequencePool.cs" t="Include" />
|
||||
<e p="SequenceReader.cs" t="Include" />
|
||||
<e p="SequenceReaderExtensions.cs" t="Include" />
|
||||
<e p="StreamPolyfillExtensions.cs" t="Include" />
|
||||
<e p="StringEncoding.cs" t="Include" />
|
||||
<e p="T4" t="Include">
|
||||
<e p="ForceSizePrimitiveFormatter.cs" t="Include" />
|
||||
<e p="MessagePackReader.Integers.cs" t="Include" />
|
||||
<e p="PrimitiveFormatter.cs" t="Include" />
|
||||
<e p="TupleFormatter.cs" t="Include" />
|
||||
<e p="UnsafeMemory.cs" t="Include" />
|
||||
<e p="ValueTupleFormatter.cs" t="Include" />
|
||||
</e>
|
||||
<e p="ThisLibraryExtensionTypeCodes.cs" t="Include" />
|
||||
<e p="Unity" t="Include">
|
||||
<e p="Extension" t="Include">
|
||||
<e p="UnityBlitResolver.cs" t="Include" />
|
||||
<e p="UnsafeBlitFormatter.cs" t="Include" />
|
||||
<e p="UniRx" t="Include">
|
||||
<e p="Examples" t="Include">
|
||||
<e p="Sample01_ObservableWWW.cs" t="Include" />
|
||||
<e p="Sample02_ObservableTriggers.cs" t="Include" />
|
||||
<e p="Sample03_GameObjectAsObservable.cs" t="Include" />
|
||||
<e p="Sample04_ConvertFromUnityCallback.cs" t="Include" />
|
||||
<e p="Sample05_ConvertFromCoroutine.cs" t="Include" />
|
||||
<e p="Sample06_ConvertToCoroutine.cs" t="Include" />
|
||||
<e p="Sample07_OrchestratIEnumerator.cs" t="Include" />
|
||||
<e p="Sample08_DetectDoubleClick.cs" t="Include" />
|
||||
<e p="Sample09_EventHandling.cs" t="Include" />
|
||||
<e p="Sample10_MainThreadDispatcher.cs" t="Include" />
|
||||
<e p="Sample11_Logger.cs" t="Include" />
|
||||
<e p="Sample12_ReactiveProperty.cs" t="Include" />
|
||||
<e p="Sample13_ToDoApp.cs" t="Include" />
|
||||
</e>
|
||||
<e p="readme.txt" t="Include" />
|
||||
<e p="Scripts" t="Include">
|
||||
<e p="Asynchronous" t="Include">
|
||||
<e p="WebRequestExtensions.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Disposables" t="Include">
|
||||
<e p="BooleanDisposable.cs" t="Include" />
|
||||
<e p="CancellationDisposable.cs" t="Include" />
|
||||
<e p="CompositeDisposable.cs" t="Include" />
|
||||
<e p="DictionaryDisposable.cs" t="Include" />
|
||||
<e p="Disposable.cs" t="Include" />
|
||||
<e p="DisposableExtensions.cs" t="Include" />
|
||||
<e p="ICancelable.cs" t="Include" />
|
||||
<e p="MultipleAssignmentDisposable.cs" t="Include" />
|
||||
<e p="RefCountDisposable.cs" t="Include" />
|
||||
<e p="ScheduledDisposable.cs" t="Include" />
|
||||
<e p="SerialDisposable.cs" t="Include" />
|
||||
<e p="SingleAssignmentDisposable.cs" t="Include" />
|
||||
<e p="StableCompositeDisposable.cs" t="Include" />
|
||||
</e>
|
||||
<e p="EventPattern.cs" t="Include" />
|
||||
<e p="InternalUtil" t="Include">
|
||||
<e p="AscynLock.cs" t="Include" />
|
||||
<e p="ImmutableList.cs" t="Include" />
|
||||
<e p="ListObserver.cs" t="Include" />
|
||||
<e p="MicroCoroutine.cs" t="Include" />
|
||||
<e p="PriorityQueue.cs" t="Include" />
|
||||
<e p="ReflectionAccessor.cs" t="Include" />
|
||||
<e p="ScheduledItem.cs" t="Include" />
|
||||
<e p="ThreadSafeQueueWorker.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Notification.cs" t="Include" />
|
||||
<e p="Notifiers" t="Include">
|
||||
<e p="BooleanNotifier.cs" t="Include" />
|
||||
<e p="CountNotifier.cs" t="Include" />
|
||||
<e p="MessageBroker.cs" t="Include" />
|
||||
<e p="ScheduledNotifier.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Observable.Aggregate.cs" t="Include" />
|
||||
<e p="Observable.Awaiter.cs" t="Include" />
|
||||
<e p="Observable.Binding.cs" t="Include" />
|
||||
<e p="Observable.Blocking.cs" t="Include" />
|
||||
<e p="Observable.Concatenate.cs" t="Include" />
|
||||
<e p="Observable.Concurrency.cs" t="Include" />
|
||||
<e p="Observable.Conversions.cs" t="Include" />
|
||||
<e p="Observable.Creation.cs" t="Include" />
|
||||
<e p="Observable.cs" t="Include" />
|
||||
<e p="Observable.ErrorHandling.cs" t="Include" />
|
||||
<e p="Observable.Events.cs" t="Include" />
|
||||
<e p="Observable.FromAsync.cs" t="Include" />
|
||||
<e p="Observable.Joins.cs" t="Include" />
|
||||
<e p="Observable.Paging.cs" t="Include" />
|
||||
<e p="Observable.Time.cs" t="Include" />
|
||||
<e p="Observer.cs" t="Include" />
|
||||
<e p="Operators" t="Include">
|
||||
<e p="Aggregate.cs" t="Include" />
|
||||
<e p="Amb.cs" t="Include" />
|
||||
<e p="AsObservable.cs" t="Include" />
|
||||
<e p="AsSingleUnitObservable.cs" t="Include" />
|
||||
<e p="AsUnitObservable.cs" t="Include" />
|
||||
<e p="Buffer.cs" t="Include" />
|
||||
<e p="Cast.cs" t="Include" />
|
||||
<e p="Catch.cs" t="Include" />
|
||||
<e p="CombineLatest.cs" t="Include" />
|
||||
<e p="Concat.cs" t="Include" />
|
||||
<e p="ContinueWith.cs" t="Include" />
|
||||
<e p="Create.cs" t="Include" />
|
||||
<e p="DefaultIfEmpty.cs" t="Include" />
|
||||
<e p="Defer.cs" t="Include" />
|
||||
<e p="Delay.cs" t="Include" />
|
||||
<e p="DelaySubscription.cs" t="Include" />
|
||||
<e p="Dematerialize.cs" t="Include" />
|
||||
<e p="Distinct.cs" t="Include" />
|
||||
<e p="DistinctUntilChanged.cs" t="Include" />
|
||||
<e p="Do.cs" t="Include" />
|
||||
<e p="Empty.cs" t="Include" />
|
||||
<e p="Finally.cs" t="Include" />
|
||||
<e p="First.cs" t="Include" />
|
||||
<e p="ForEachAsync.cs" t="Include" />
|
||||
<e p="FromEvent.cs" t="Include" />
|
||||
<e p="GroupBy.cs" t="Include" />
|
||||
<e p="IgnoreElements.cs" t="Include" />
|
||||
<e p="Last.cs" t="Include" />
|
||||
<e p="Materialize.cs" t="Include" />
|
||||
<e p="Merge.cs" t="Include" />
|
||||
<e p="Never.cs" t="Include" />
|
||||
<e p="ObserveOn.cs" t="Include" />
|
||||
<e p="OfType.cs" t="Include" />
|
||||
<e p="OperatorObservableBase.cs" t="Include" />
|
||||
<e p="OperatorObserverBase.cs" t="Include" />
|
||||
<e p="PairWise.cs" t="Include" />
|
||||
<e p="Range.cs" t="Include" />
|
||||
<e p="RefCount.cs" t="Include" />
|
||||
<e p="Repeat.cs" t="Include" />
|
||||
<e p="RepeatSafe.cs" t="Include" />
|
||||
<e p="Return.cs" t="Include" />
|
||||
<e p="Sample.cs" t="Include" />
|
||||
<e p="Scan.cs" t="Include" />
|
||||
<e p="Select.cs" t="Include" />
|
||||
<e p="SelectMany.cs" t="Include" />
|
||||
<e p="SelectWhere.cs" t="Include" />
|
||||
<e p="Single.cs" t="Include" />
|
||||
<e p="Skip.cs" t="Include" />
|
||||
<e p="SkipUntil.cs" t="Include" />
|
||||
<e p="SkipWhile.cs" t="Include" />
|
||||
<e p="Start.cs" t="Include" />
|
||||
<e p="StartWith.cs" t="Include" />
|
||||
<e p="SubscribeOn.cs" t="Include" />
|
||||
<e p="Switch.cs" t="Include" />
|
||||
<e p="Synchronize.cs" t="Include" />
|
||||
<e p="SynchronizedObserver.cs" t="Include" />
|
||||
<e p="Take.cs" t="Include" />
|
||||
<e p="TakeLast.cs" t="Include" />
|
||||
<e p="TakeUntil.cs" t="Include" />
|
||||
<e p="TakeWhile.cs" t="Include" />
|
||||
<e p="Throttle.cs" t="Include" />
|
||||
<e p="ThrottleFirst.cs" t="Include" />
|
||||
<e p="Throw.cs" t="Include" />
|
||||
<e p="TimeInterval.cs" t="Include" />
|
||||
<e p="Timeout.cs" t="Include" />
|
||||
<e p="Timer.cs" t="Include" />
|
||||
<e p="Timestamp.cs" t="Include" />
|
||||
<e p="ToArray.cs" t="Include" />
|
||||
<e p="ToList.cs" t="Include" />
|
||||
<e p="ToObservable.cs" t="Include" />
|
||||
<e p="Wait.cs" t="Include" />
|
||||
<e p="WhenAll.cs" t="Include" />
|
||||
<e p="Where.cs" t="Include" />
|
||||
<e p="WhereSelect.cs" t="Include" />
|
||||
<e p="WithLatestFrom.cs" t="Include" />
|
||||
<e p="Zip.cs" t="Include" />
|
||||
<e p="ZipLatest.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Pair.cs" t="Include" />
|
||||
<e p="Schedulers" t="Include">
|
||||
<e p="CurrentThreadScheduler.cs" t="Include" />
|
||||
<e p="ImmediateScheduler.cs" t="Include" />
|
||||
<e p="IScheduler.cs" t="Include" />
|
||||
<e p="Scheduler.cs" t="Include" />
|
||||
<e p="ThreadPoolScheduler.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Subjects" t="Include">
|
||||
<e p="AsyncSubject.cs" t="Include" />
|
||||
<e p="BehaviorSubject.cs" t="Include" />
|
||||
<e p="ConnectableObservable.cs" t="Include" />
|
||||
<e p="ISubject.cs" t="Include" />
|
||||
<e p="ReplaySubject.cs" t="Include" />
|
||||
<e p="Subject.cs" t="Include" />
|
||||
<e p="SubjectExtensions.cs" t="Include" />
|
||||
</e>
|
||||
<e p="system" t="Include">
|
||||
<e p="IObservable.cs" t="Include" />
|
||||
<e p="IObserver.cs" t="Include" />
|
||||
<e p="IOptimizedObservable.cs" t="Include" />
|
||||
<e p="IProgress.cs" t="Include" />
|
||||
<e p="Tuple.cs" t="Include" />
|
||||
<e p="Unit.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Tasks" t="Include">
|
||||
<e p="TaskObservableExtensions.cs" t="Include" />
|
||||
</e>
|
||||
<e p="TimeInterval.cs" t="Include" />
|
||||
<e p="Timestamped.cs" t="Include" />
|
||||
<e p="UnityEngineBridge" t="Include">
|
||||
<e p="AotSafeExtensions.cs" t="Include" />
|
||||
<e p="AsyncOperationExtensions.cs" t="Include" />
|
||||
<e p="CancellationToken.cs" t="Include" />
|
||||
<e p="CoroutineAsyncBridge.cs" t="Include" />
|
||||
<e p="Diagnostics" t="Include">
|
||||
<e p="LogEntry.cs" t="Include" />
|
||||
<e p="LogEntryExtensions.cs" t="Include" />
|
||||
<e p="Logger.cs" t="Include" />
|
||||
<e p="ObservableDebugExtensions.cs" t="Include" />
|
||||
<e p="ObservableLogger.cs" t="Include" />
|
||||
<e p="UnityDebugSink.cs" t="Include" />
|
||||
</e>
|
||||
<e p="FrameInterval.cs" t="Include" />
|
||||
<e p="InspectableReactiveProperty.cs" t="Include" />
|
||||
<e p="InspectorDisplayDrawer.cs" t="Include" />
|
||||
<e p="LazyTask.cs" t="Include" />
|
||||
<e p="LifetimeDisposableExtensions.cs" t="Include" />
|
||||
<e p="MainThreadDispatcher.cs" t="Include" />
|
||||
<e p="MainThreadScheduler.cs" t="Include" />
|
||||
<e p="Observable.Unity.cs" t="Include" />
|
||||
<e p="ObservableMonoBehaviour.cs" t="Include" />
|
||||
<e p="ObservableWWW.cs" t="Include" />
|
||||
<e p="ObserveExtensions.cs" t="Include" />
|
||||
<e p="Operators" t="Include">
|
||||
<e p="BatchFrame.cs" t="Include" />
|
||||
<e p="DelayFrame.cs" t="Include" />
|
||||
<e p="DelayFrameSubscription.cs" t="Include" />
|
||||
<e p="FrameInterval.cs" t="Include" />
|
||||
<e p="FrameTimeInterval.cs" t="Include" />
|
||||
<e p="FromCoroutine.cs" t="Include" />
|
||||
<e p="RepeatUntil.cs" t="Include" />
|
||||
<e p="SampleFrame.cs" t="Include" />
|
||||
<e p="SubscribeOnMainThread.cs" t="Include" />
|
||||
<e p="ThrottleFirstFrame.cs" t="Include" />
|
||||
<e p="ThrottleFrame.cs" t="Include" />
|
||||
<e p="TimeoutFrame.cs" t="Include" />
|
||||
</e>
|
||||
<e p="PresenterBase.cs" t="Include" />
|
||||
<e p="ReactiveCollection.cs" t="Include" />
|
||||
<e p="ReactiveCommand.cs" t="Include" />
|
||||
<e p="ReactiveDictionary.cs" t="Include" />
|
||||
<e p="ReactiveProperty.cs" t="Include" />
|
||||
<e p="ScenePlaybackDetector.cs" t="Include" />
|
||||
<e p="Toolkit" t="Include">
|
||||
<e p="ObjectPool.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Triggers" t="Include">
|
||||
<e p="ObservableAnimatorTrigger.cs" t="Include" />
|
||||
<e p="ObservableBeginDragTrigger.cs" t="Include" />
|
||||
<e p="ObservableCancelTrigger.cs" t="Include" />
|
||||
<e p="ObservableCanvasGroupChangedTrigger.cs" t="Include" />
|
||||
<e p="ObservableCollision2DTrigger.cs" t="Include" />
|
||||
<e p="ObservableCollisionTrigger.cs" t="Include" />
|
||||
<e p="ObservableDeselectTrigger.cs" t="Include" />
|
||||
<e p="ObservableDestroyTrigger.cs" t="Include" />
|
||||
<e p="ObservableDragTrigger.cs" t="Include" />
|
||||
<e p="ObservableDropTrigger.cs" t="Include" />
|
||||
<e p="ObservableEnableTrigger.cs" t="Include" />
|
||||
<e p="ObservableEndDragTrigger.cs" t="Include" />
|
||||
<e p="ObservableEventTrigger.cs" t="Include" />
|
||||
<e p="ObservableFixedUpdateTrigger.cs" t="Include" />
|
||||
<e p="ObservableInitializePotentialDragTrigger.cs" t="Include" />
|
||||
<e p="ObservableLateUpdateTrigger.cs" t="Include" />
|
||||
<e p="ObservableMouseTrigger.cs" t="Include" />
|
||||
<e p="ObservableMoveTrigger.cs" t="Include" />
|
||||
<e p="ObservableParticleTrigger.cs" t="Include" />
|
||||
<e p="ObservablePointerClickTrigger.cs" t="Include" />
|
||||
<e p="ObservablePointerDownTrigger.cs" t="Include" />
|
||||
<e p="ObservablePointerEnterTrigger.cs" t="Include" />
|
||||
<e p="ObservablePointerExitTrigger.cs" t="Include" />
|
||||
<e p="ObservablePointerUpTrigger.cs" t="Include" />
|
||||
<e p="ObservableRectTransformTrigger.cs" t="Include" />
|
||||
<e p="ObservableScrollTrigger.cs" t="Include" />
|
||||
<e p="ObservableSelectTrigger.cs" t="Include" />
|
||||
<e p="ObservableStateMachineTrigger.cs" t="Include" />
|
||||
<e p="ObservableSubmitTrigger.cs" t="Include" />
|
||||
<e p="ObservableTransformChangedTrigger.cs" t="Include" />
|
||||
<e p="ObservableTrigger2DTrigger.cs" t="Include" />
|
||||
<e p="ObservableTriggerBase.cs" t="Include" />
|
||||
<e p="ObservableTriggerExtensions.Component.cs" t="Include" />
|
||||
<e p="ObservableTriggerExtensions.cs" t="Include" />
|
||||
<e p="ObservableTriggerTrigger.cs" t="Include" />
|
||||
<e p="ObservableUpdateSelectedTrigger.cs" t="Include" />
|
||||
<e p="ObservableUpdateTrigger.cs" t="Include" />
|
||||
<e p="ObservableVisibleTrigger.cs" t="Include" />
|
||||
</e>
|
||||
<e p="TypedMonoBehaviour.cs" t="Include" />
|
||||
<e p="UniRxSynchronizationContext.cs" t="Include" />
|
||||
<e p="UnityEqualityComparer.cs" t="Include" />
|
||||
<e p="UnityEventExtensions.cs" t="Include" />
|
||||
<e p="UnityGraphicExtensions.cs" t="Include" />
|
||||
<e p="UnityUIComponentExtensions.cs" t="Include" />
|
||||
<e p="YieldInstructionCache.cs" t="Include" />
|
||||
</e>
|
||||
<e p="UnityWinRTBridge" t="Include">
|
||||
<e p="Thread.cs" t="Include" />
|
||||
<e p="ThreadPoolScheduler_UnityWinRT.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="Formatters.cs" t="Include" />
|
||||
<e p="MessagePackWindow.cs" t="Include" />
|
||||
<e p="UnityResolver.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Utilities.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Orbit.cs" t="Include" />
|
||||
<e p="PropertiesPanel.cs" t="Include" />
|
||||
<e p="Prototype.cs" t="Include" />
|
||||
<e p="ServerShared" t="Include">
|
||||
<e p="Economy.Shared.Unity.asmdef" t="Include" />
|
||||
<e p="Hubs" t="Include">
|
||||
|
|
@ -206,6 +690,11 @@
|
|||
<e p="IChatService.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="ZoneManager.cs" t="Include" />
|
||||
</e>
|
||||
<e p="Shaders" t="Include">
|
||||
<e p="CubicPulseBrush.shader" t="Include" />
|
||||
<e p="Isolines.shader" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="Economy.Shared.Unity.csproj" t="IncludeRecursive" />
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
<component name="ContentModelUserStore">
|
||||
<attachedFolders />
|
||||
<explicitIncludes>
|
||||
<Path>Library/PackageCache/com.unity.mathematics@1.1.0</Path>
|
||||
<Path>Library/PackageCache/com.unity.package-manager-ui@2.0.8</Path>
|
||||
<Path>Library/PackageCache/com.unity.textmeshpro@1.4.1</Path>
|
||||
<Path>Packages</Path>
|
||||
|
|
|
|||
1
.idea/.idea.Economy/.idea/indexLayout.xml
generated
1
.idea/.idea.Economy/.idea/indexLayout.xml
generated
|
|
@ -4,6 +4,7 @@
|
|||
<attachedFolders />
|
||||
<explicitIncludes>
|
||||
<Path>Assets</Path>
|
||||
<Path>Library/PackageCache/com.unity.mathematics@1.1.0</Path>
|
||||
<Path>Library/PackageCache/com.unity.package-manager-ui@2.0.8</Path>
|
||||
<Path>Library/PackageCache/com.unity.textmeshpro@1.4.1</Path>
|
||||
<Path>Packages</Path>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Economy.Shared.Unity", "Economy.Shared.Unity.csproj", "{A62B36C2-E9DE-B992-0779-F5FCF5968986}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "Assembly-CSharp-Editor.csproj", "{E389FCA7-CA14-82FB-7D67-C13788BEE74A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
|
@ -42,6 +44,10 @@ Global
|
|||
{A62B36C2-E9DE-B992-0779-F5FCF5968986}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A62B36C2-E9DE-B992-0779-F5FCF5968986}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A62B36C2-E9DE-B992-0779-F5FCF5968986}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E389FCA7-CA14-82FB-7D67-C13788BEE74A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E389FCA7-CA14-82FB-7D67-C13788BEE74A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E389FCA7-CA14-82FB-7D67-C13788BEE74A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E389FCA7-CA14-82FB-7D67-C13788BEE74A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
|||
798
Assembly-CSharp-Editor.csproj
Normal file
798
Assembly-CSharp-Editor.csproj
Normal file
|
|
@ -0,0 +1,798 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<_TargetFrameworkDirectories>non_empty_path_generated_by_rider_editor_plugin</_TargetFrameworkDirectories>
|
||||
<_FullFrameworkReferenceAssemblyPaths>non_empty_path_generated_by_rider_editor_plugin</_FullFrameworkReferenceAssemblyPaths>
|
||||
<DisableHandlePackageFileConflicts>true</DisableHandlePackageFileConflicts>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>10.0.20506</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<RootNamespace></RootNamespace>
|
||||
<ProjectGuid>{E389FCA7-CA14-82FB-7D67-C13788BEE74A}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<AssemblyName>Assembly-CSharp-Editor</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<BaseDirectory>.</BaseDirectory>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>Temp\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_6_OR_NEWER;UNITY_2017_1_OR_NEWER;UNITY_2017_2_OR_NEWER;UNITY_2017_3_OR_NEWER;UNITY_2017_4_OR_NEWER;UNITY_2018_1_OR_NEWER;UNITY_2018_2_OR_NEWER;UNITY_2018_3_OR_NEWER;UNITY_2018_4_OR_NEWER;UNITY_2018_4_17;UNITY_2018_4;UNITY_2018;PLATFORM_ARCH_64;UNITY_64;UNITY_INCLUDE_TESTS;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITES;ENABLE_GRID;ENABLE_TILEMAP;ENABLE_TERRAIN;ENABLE_TEXTURE_STREAMING;ENABLE_DIRECTOR;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_COLLAB_SOFTLOCKS;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_USE_WEBREQUEST;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_HUB;ENABLE_EDITOR_HUB_LICENSE;ENABLE_WEBSOCKET_CLIENT;ENABLE_DIRECTOR_AUDIO;ENABLE_DIRECTOR_TEXTURE;ENABLE_TIMELINE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;ENABLE_MANAGED_JOBS;ENABLE_MANAGED_TRANSFORM_JOBS;ENABLE_MANAGED_ANIMATION_JOBS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;ENABLE_MONO_BDWGC;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_VIDEO;ENABLE_CUSTOM_RENDER_TEXTURE;ENABLE_LOCALIZATION;PLATFORM_STANDALONE_WIN;PLATFORM_STANDALONE;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_OUT_OF_PROCESS_CRASH_HANDLER;ENABLE_EVENT_QUEUE;ENABLE_CLUSTER_SYNC;ENABLE_CLUSTERINPUT;ENABLE_VR;ENABLE_AR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;NET_4_6;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;ENABLE_UNITY_COLLECTIONS_CHECKS;ENABLE_BURST_AOT;UNITY_TEAM_LICENSE;CSHARP_7_OR_LATER;CSHARP_7_3_OR_NEWER</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169</NoWarn>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>Temp\bin\Release\</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn>0169</NoWarn>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<NoConfig>true</NoConfig>
|
||||
<NoStdLib>true</NoStdLib>
|
||||
<AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>
|
||||
<ImplicitlyExpandNETStandardFacades>false</ImplicitlyExpandNETStandardFacades>
|
||||
<ImplicitlyExpandDesignTimeFacades>false</ImplicitlyExpandDesignTimeFacades>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="UnityEngine">
|
||||
<HintPath>C:\Program Files\Unity\Hub\Editor\2018.4.17f1\Editor\Data\Managed/UnityEngine/UnityEngine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor">
|
||||
<HintPath>C:\Program Files\Unity\Hub\Editor\2018.4.17f1\Editor\Data\Managed/UnityEditor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp">
|
||||
<HintPath>C:\Program Files\Unity\Hub\Editor\2018.4.17f1\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\Microsoft.CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\BaseAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\FieldDrawerAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\IAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\MethodDrawerAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\NativePropertyDrawerAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\PropertyDrawConditionAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\PropertyDrawerAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\PropertyGrouperAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\PropertyMetaAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Attributes\PropertyValidatorAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\CodeGenerator.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\FieldDrawerDatabase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\MethodDrawerDatabase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\NativePropertyDrawerDatabase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\PropertyDrawConditionDatabase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\PropertyDrawerDatabase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\PropertyGrouperDatabase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\PropertyMetaDatabase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\PropertyValidatorDatabase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Editors\InspectorEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\FieldDrawers\FieldDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\FieldDrawers\ShowNonSerializedFieldFieldDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\MethodDrawers\ButtonMethodDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\MethodDrawers\MethodDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\NativePropertyDrawers\NativePropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\NativePropertyDrawers\ShowNativePropertyNativePropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawConditions\HideIfPropertyDrawCondition.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawConditions\PropertyDrawCondition.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawConditions\ShowIfPropertyDrawCondition.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawers\DropdownPropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawers\MinMaxSliderPropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawers\PropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawers\ReadOnlyPropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawers\ReorderableListPropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawers\ResizableTextAreaPropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawers\ShowAssetPreviewPropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyDrawers\SliderPropertyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyGroupers\BoxGroupPropertyGrouper.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyGroupers\PropertyGrouper.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyMetas\BlankSpacePropertyMeta.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyMetas\InfoBoxPropertyMeta.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyMetas\OnValueChangedPropertyMeta.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyMetas\PropertyMeta.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyMetas\SectionPropertyMeta.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyValidators\MaxValuePropertyValidator.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyValidators\MinValuePropertyValidator.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyValidators\PropertyValidator.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyValidators\RequiredPropertyValidator.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\PropertyValidators\ValidateInputPropertyValidator.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Utility\EditorDrawUtility.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Utility\IOUtility.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\Utility\PropertyUtility.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\AccordionElementEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\BezierLineRendererEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\BoxSliderEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\CanvasGroupActivator.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\CUIBezierCurveEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\CUIGraphicEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\CUIImageEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\CUITextEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\NonDrawingGraphicEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\ReadOnlyDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\TextPicEditor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\uGUITools.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Editor\UIExtensionsMenuOptions.cs" />
|
||||
<None Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\Templates\FieldDrawerDatabaseTemplate.txt" />
|
||||
<None Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\Templates\MethodDrawerDatabaseTemplate.txt" />
|
||||
<None Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\Templates\PropertyValidatorDatabaseTemplate.txt" />
|
||||
<None Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\Templates\PropertyDrawConditionDatabaseTemplate.txt" />
|
||||
<None Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\Templates\PropertyDrawerDatabaseTemplate.txt" />
|
||||
<None Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\Templates\PropertyMetaDatabaseTemplate.txt" />
|
||||
<None Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\Templates\NativePropertyDrawerDbTemplate.txt" />
|
||||
<None Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Editor\CodeGeneration\Templates\PropertyGrouperDatabaseTemplate.txt" />
|
||||
<Reference Include="Unity.TextMeshPro.Editor">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.PackageManagerUI.Editor">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.PackageManagerUI.Editor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.TextMeshPro">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.TextMeshPro.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Mathematics">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.Mathematics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Mathematics.Editor">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.Mathematics.Editor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.AIModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.ARModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.ARModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.AccessibilityModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.AccessibilityModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.AnimationModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.AnimationModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.AssetBundleModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.AssetBundleModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.AudioModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.AudioModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.BaselibModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.BaselibModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.ClothModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.ClothModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.ClusterInputModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterInputModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.ClusterRendererModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.ClusterRendererModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CoreModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.CoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.CrashReportingModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.CrashReportingModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.DirectorModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.DirectorModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.FileSystemHttpModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.FileSystemHttpModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.GameCenterModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.GameCenterModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.GridModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.GridModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.HotReloadModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.HotReloadModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.IMGUIModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.IMGUIModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.ImageConversionModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.ImageConversionModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.InputModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.InputModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.JSONSerializeModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.JSONSerializeModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.LocalizationModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.LocalizationModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.ParticleSystemModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.ParticleSystemModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.PerformanceReportingModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.PerformanceReportingModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.PhysicsModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.PhysicsModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.Physics2DModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.Physics2DModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.ProfilerModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.ProfilerModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.ScreenCaptureModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.ScreenCaptureModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.SharedInternalsModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.SharedInternalsModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.SpatialTrackingModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.SpatialTrackingModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.SpriteMaskModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteMaskModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.SpriteShapeModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.SpriteShapeModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.StreamingModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.StreamingModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.StyleSheetsModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.StyleSheetsModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.SubstanceModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.SubstanceModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TLSModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.TLSModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TerrainModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TerrainPhysicsModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.TerrainPhysicsModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TextCoreModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.TextCoreModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TextRenderingModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.TextRenderingModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TilemapModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.TilemapModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TimelineModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.TimelineModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UIModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UIModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UIElementsModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UIElementsModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UNETModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UNETModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UmbraModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UmbraModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityAnalyticsModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UnityAnalyticsModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityConnectModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UnityConnectModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityTestProtocolModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UnityTestProtocolModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityWebRequestModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityWebRequestAssetBundleModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAssetBundleModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityWebRequestAudioModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestAudioModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityWebRequestTextureModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestTextureModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UnityWebRequestWWWModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.UnityWebRequestWWWModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.VFXModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.VFXModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.VRModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.VRModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.VehiclesModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.VehiclesModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.VideoModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.VideoModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.WindModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.WindModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.XRModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.XRModule.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Locator">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/Unity.Locator.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.UI">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.UI">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/GUISystem/Editor/UnityEditor.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.TestRunner">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/TestRunner/Editor/UnityEditor.TestRunner.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.TestRunner">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/TestRunner/UnityEngine.TestRunner.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/TestRunner/net35/unity-custom/nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.Timeline">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/Timeline/RuntimeEditor/UnityEngine.Timeline.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.Timeline">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/Timeline/Editor/UnityEditor.Timeline.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.Networking">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.Networking">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.GoogleAudioSpatializer">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/Editor/UnityEditor.GoogleAudioSpatializer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.GoogleAudioSpatializer">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/UnityGoogleAudioSpatializer/RuntimeEditor/UnityEngine.GoogleAudioSpatializer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.SpatialTracking">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/Editor/UnityEditor.SpatialTracking.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.SpatialTracking">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.VR">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/UnityExtensions/Unity/UnityVR/Editor/UnityEditor.VR.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.Graphs">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEditor.Graphs.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.WebGL.Extensions">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEditor.WindowsStandalone.Extensions">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Buffers">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Assets/Plugins/System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Memory">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Assets/Plugins/System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Assets/Plugins/System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Assets/Plugins/System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Grpc.Core">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Assets/Plugins/Grpc.Core/lib/net45/Grpc.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Grpc.Core.Api">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Assets/Plugins/Grpc.Core.Api/lib/net45/Grpc.Core.Api.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Google.Protobuf">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Assets/Plugins/Google.Protobuf/lib/net45/Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="JetBrains.Rider.Unity.Editor.Plugin.Repacked">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Assets/Plugins/Editor/JetBrains/JetBrains.Rider.Unity.Editor.Plugin.Repacked.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="mscorlib">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/mscorlib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Core">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.Runtime.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.Xml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.Xml.Linq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.Numerics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics.Vectors">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.Net.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Microsoft.CSharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/System.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Win32.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/Microsoft.Win32.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="netstandard">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/netstandard.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.AppContext">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.AppContext.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections.Concurrent">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Collections.Concurrent.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections.NonGeneric">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Collections.NonGeneric.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Collections.Specialized">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Collections.Specialized.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Annotations">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ComponentModel.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ComponentModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.EventBasedAsync">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ComponentModel.EventBasedAsync.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ComponentModel.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.TypeConverter">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ComponentModel.TypeConverter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Console">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Console.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.Common">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Data.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.Contracts">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Diagnostics.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.Debug">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Diagnostics.Debug.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.FileVersionInfo">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Diagnostics.FileVersionInfo.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.Process">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Diagnostics.Process.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.StackTrace">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Diagnostics.StackTrace.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.TextWriterTraceListener">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Diagnostics.TextWriterTraceListener.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.Tools">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Diagnostics.Tools.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Diagnostics.TraceSource">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Diagnostics.TraceSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Drawing.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Dynamic.Runtime">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Dynamic.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Globalization.Calendars">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Globalization.Calendars.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Globalization">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Globalization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Globalization.Extensions">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Globalization.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Compression.ZipFile">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.Compression.ZipFile.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.FileSystem.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem.DriveInfo">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.FileSystem.DriveInfo.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.FileSystem.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.FileSystem.Watcher">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.FileSystem.Watcher.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.IsolatedStorage">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.IsolatedStorage.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.MemoryMappedFiles">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.MemoryMappedFiles.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.Pipes">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.Pipes.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.IO.UnmanagedMemoryStream">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.IO.UnmanagedMemoryStream.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Linq">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Linq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Linq.Expressions">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Linq.Expressions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Linq.Parallel">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Linq.Parallel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Linq.Queryable">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Linq.Queryable.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.Rtc">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.Http.Rtc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.NameResolution">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.NameResolution.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.NetworkInformation">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.NetworkInformation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Ping">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.Ping.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Requests">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.Requests.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Security">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Sockets">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.Sockets.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebHeaderCollection">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.WebHeaderCollection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebSockets.Client">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.WebSockets.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.WebSockets">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Net.WebSockets.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ObjectModel">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ObjectModel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Reflection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.Emit">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Reflection.Emit.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.Emit.ILGeneration">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Reflection.Emit.ILGeneration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.Emit.Lightweight">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Reflection.Emit.Lightweight.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.Extensions">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Reflection.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reflection.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Reflection.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Resources.Reader">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Resources.Reader.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Resources.ResourceManager">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Resources.ResourceManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Resources.Writer">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Resources.Writer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.VisualC">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.CompilerServices.VisualC.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Extensions">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Handles">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.Handles.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.InteropServices.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.RuntimeInformation">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.InteropServices.RuntimeInformation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.InteropServices.WindowsRuntime">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.InteropServices.WindowsRuntime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Numerics">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.Numerics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization.Formatters">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.Serialization.Formatters.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization.Json">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.Serialization.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.Serialization.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization.Xml">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Runtime.Serialization.Xml.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Claims">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Security.Claims.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Algorithms">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Security.Cryptography.Algorithms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Csp">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Security.Cryptography.Csp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Encoding">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Security.Cryptography.Encoding.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Security.Cryptography.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Cryptography.X509Certificates">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Security.Cryptography.X509Certificates.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.Principal">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Security.Principal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Security.SecureString">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Security.SecureString.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel.Duplex">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ServiceModel.Duplex.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel.Http">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ServiceModel.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel.NetTcp">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ServiceModel.NetTcp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel.Primitives">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ServiceModel.Primitives.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceModel.Security">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ServiceModel.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encoding">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Text.Encoding.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.Encoding.Extensions">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Text.Encoding.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Text.RegularExpressions">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Text.RegularExpressions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Threading.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Overlapped">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Threading.Overlapped.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Threading.Tasks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Parallel">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Threading.Tasks.Parallel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Thread">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Threading.Thread.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.ThreadPool">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Threading.ThreadPool.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Timer">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Threading.Timer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ValueTuple">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.ValueTuple.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.ReaderWriter">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Xml.ReaderWriter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.XDocument">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Xml.XDocument.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.XmlDocument">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Xml.XmlDocument.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.XmlSerializer">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Xml.XmlSerializer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.XPath">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Xml.XPath.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.XPath.XDocument">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/4.7.1-api/Facades/System.Xml.XPath.XDocument.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityScript">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/unityscript/UnityScript.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityScript.Lang">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/unityscript/UnityScript.Lang.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Boo.Lang">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/MonoBleedingEdge/lib/mono/unityscript/Boo.Lang.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="Assembly-CSharp.csproj">
|
||||
<Project>{29B684F0-E616-CD9C-EFF8-10A39DB37A52}</Project>
|
||||
<Name>Assembly-CSharp</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Economy.Shared.Unity.csproj">
|
||||
<Project>{A62B36C2-E9DE-B992-0779-F5FCF5968986}</Project>
|
||||
<Name>Economy.Shared.Unity</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="MagicOnion.csproj">
|
||||
<Project>{8646472B-6F4E-DCCA-A987-99E48366FF7F}</Project>
|
||||
<Name>MagicOnion</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="MagicOnion.Unity.csproj">
|
||||
<Project>{B83AC090-25E2-7BA3-4612-A18BBB80B3E6}</Project>
|
||||
<Name>MagicOnion.Unity</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="MagicOnion.Abstractions.csproj">
|
||||
<Project>{7A90811F-E771-FAB4-C8B5-EA6DF36C4D19}</Project>
|
||||
<Name>MagicOnion.Abstractions</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="MessagePack.csproj">
|
||||
<Project>{21EF11C5-27DC-3D88-B027-9A4B6F36BAE4}</Project>
|
||||
<Name>MessagePack</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
|
|
@ -61,9 +61,525 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Assets\Scripts\ChatComponent.cs" />
|
||||
<Compile Include="Assets\Scripts\ColorButton.cs" />
|
||||
<Compile Include="Assets\Scripts\Database.cs" />
|
||||
<Compile Include="Assets\Scripts\Extensions.cs" />
|
||||
<Compile Include="Assets\Scripts\Galaxy.cs" />
|
||||
<Compile Include="Assets\Scripts\Generated\MagicOnion.Generated.cs" />
|
||||
<Compile Include="Assets\Scripts\Generated\MessagePack.Generated.cs" />
|
||||
<Compile Include="Assets\Scripts\InitialSettings.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\FastNoise.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Aggregate.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\AnyAll.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Average.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Contains.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Count.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Distinct.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\First.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Last.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Max.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Min.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\OrderBy.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Range.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Repeat.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Reverse.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Select.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\SelectMany.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\SelectWhere.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\SequenceEqual.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Single.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Skip.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Sum.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Take.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Utils\ComparerMagic.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Utils\CustomPartition.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Utils\Error.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Utils\GenericOperators.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Where.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\WhereAggregate.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\WhereSelect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\WhereSum.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\LinqFaster\Zip.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Cell2.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Constants.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull\Collections.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull\ConvexFace.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull\ConvexHullAlgorithm.Initialize.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull\ConvexHullAlgorithm.MainLoop.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull\DataModel.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull\MathHelper.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\ConvexHull\ObjectManager.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Face3.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\IVertex.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Triangulation.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Triangulation\DelaunayTrianglationInternal.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Triangulation\DelaunayTriangulation.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Triangulation\TriangulationCell.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Triangulation\VoronoiEdge.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Triangulation\VoronoiMesh.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Vertex2.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\MIConvexHull\Vertex3.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawConditionAttributes\DrawConditionAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawConditionAttributes\HideIfAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawConditionAttributes\ShowIfAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ButtonAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\DrawerAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\DropdownAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\MinMaxSliderAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ReadOnlyAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ReorderableListAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ResizableTextAreaAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ShowAssetPreviewAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ShowNativePropertyAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\ShowNonSerializedFieldAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\DrawerAttributes\SliderAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\GroupAttributes\BoxGroupAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\GroupAttributes\GroupAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\MetaAttributes\BlankSpaceAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\MetaAttributes\InfoBoxAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\MetaAttributes\MetaAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\MetaAttributes\OnValueChangedAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\MetaAttributes\SectionAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\NaughtyAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\ValidatorAttributes\MaxValueAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\ValidatorAttributes\MinValueAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\ValidatorAttributes\RequiredAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\ValidatorAttributes\ValidateInputAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\NaughtyAttributes\Scripts\Core\ValidatorAttributes\ValidatorAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample01_ObservableWWW.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample02_ObservableTriggers.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample03_GameObjectAsObservable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample04_ConvertFromUnityCallback.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample05_ConvertFromCoroutine.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample06_ConvertToCoroutine.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample07_OrchestratIEnumerator.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample08_DetectDoubleClick.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample09_EventHandling.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample10_MainThreadDispatcher.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample11_Logger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample12_ReactiveProperty.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Examples\Sample13_ToDoApp.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Asynchronous\WebRequestExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\BooleanDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\CancellationDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\CompositeDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\DictionaryDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\Disposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\DisposableExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\ICancelable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\MultipleAssignmentDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\RefCountDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\ScheduledDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\SerialDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\SingleAssignmentDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Disposables\StableCompositeDisposable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\EventPattern.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\InternalUtil\AscynLock.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\InternalUtil\ImmutableList.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\InternalUtil\ListObserver.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\InternalUtil\MicroCoroutine.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\InternalUtil\PriorityQueue.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\InternalUtil\ReflectionAccessor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\InternalUtil\ScheduledItem.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\InternalUtil\ThreadSafeQueueWorker.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Notification.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Notifiers\BooleanNotifier.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Notifiers\CountNotifier.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Notifiers\MessageBroker.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Notifiers\ScheduledNotifier.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Aggregate.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Awaiter.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Binding.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Blocking.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Concatenate.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Concurrency.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Conversions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Creation.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.ErrorHandling.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Events.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.FromAsync.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Joins.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Paging.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observable.Time.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Observer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Aggregate.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Amb.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\AsObservable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\AsSingleUnitObservable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\AsUnitObservable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Buffer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Cast.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Catch.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\CombineLatest.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Concat.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\ContinueWith.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Create.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\DefaultIfEmpty.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Defer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Delay.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\DelaySubscription.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Dematerialize.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Distinct.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\DistinctUntilChanged.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Do.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Empty.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Finally.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\First.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\ForEachAsync.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\FromEvent.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\GroupBy.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\IgnoreElements.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Last.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Materialize.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Merge.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Never.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\ObserveOn.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\OfType.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\OperatorObservableBase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\OperatorObserverBase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\PairWise.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Range.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\RefCount.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Repeat.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\RepeatSafe.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Return.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Sample.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Scan.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Select.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\SelectMany.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\SelectWhere.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Single.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Skip.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\SkipUntil.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\SkipWhile.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Start.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\StartWith.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\SubscribeOn.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Switch.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Synchronize.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\SynchronizedObserver.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Take.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\TakeLast.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\TakeUntil.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\TakeWhile.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Throttle.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\ThrottleFirst.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Throw.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\TimeInterval.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Timeout.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Timer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Timestamp.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\ToArray.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\ToList.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\ToObservable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Wait.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\WhenAll.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Where.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\WhereSelect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\WithLatestFrom.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\Zip.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Operators\ZipLatest.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Pair.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Schedulers\CurrentThreadScheduler.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Schedulers\ImmediateScheduler.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Schedulers\IScheduler.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Schedulers\Scheduler.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Schedulers\ThreadPoolScheduler.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Subjects\AsyncSubject.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Subjects\BehaviorSubject.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Subjects\ConnectableObservable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Subjects\ISubject.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Subjects\ReplaySubject.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Subjects\Subject.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Subjects\SubjectExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\System\IObservable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\System\IObserver.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\System\IOptimizedObservable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\System\IProgress.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\System\Tuple.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\System\Unit.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Tasks\TaskObservableExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\TimeInterval.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\Timestamped.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\AotSafeExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\AsyncOperationExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\CancellationToken.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\CoroutineAsyncBridge.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Diagnostics\LogEntry.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Diagnostics\LogEntryExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Diagnostics\Logger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Diagnostics\ObservableDebugExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Diagnostics\ObservableLogger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Diagnostics\UnityDebugSink.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\FrameInterval.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\InspectableReactiveProperty.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\InspectorDisplayDrawer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\LazyTask.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\LifetimeDisposableExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\MainThreadDispatcher.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\MainThreadScheduler.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Observable.Unity.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\ObservableMonoBehaviour.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\ObservableWWW.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\ObserveExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\BatchFrame.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\DelayFrame.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\DelayFrameSubscription.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\FrameInterval.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\FrameTimeInterval.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\FromCoroutine.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\RepeatUntil.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\SampleFrame.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\SubscribeOnMainThread.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\ThrottleFirstFrame.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\ThrottleFrame.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Operators\TimeoutFrame.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\PresenterBase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\ReactiveCollection.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\ReactiveCommand.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\ReactiveDictionary.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\ReactiveProperty.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\ScenePlaybackDetector.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Toolkit\ObjectPool.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableAnimatorTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableBeginDragTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableCancelTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableCanvasGroupChangedTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableCollision2DTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableCollisionTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableDeselectTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableDestroyTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableDragTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableDropTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableEnableTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableEndDragTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableEventTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableFixedUpdateTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableInitializePotentialDragTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableLateUpdateTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableMouseTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableMoveTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableParticleTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservablePointerClickTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservablePointerDownTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservablePointerEnterTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservablePointerExitTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservablePointerUpTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableRectTransformTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableScrollTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableSelectTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableStateMachineTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableSubmitTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableTransformChangedTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableTrigger2DTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableTriggerBase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableTriggerExtensions.Component.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableTriggerExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableTriggerTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableUpdateSelectedTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableUpdateTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\Triggers\ObservableVisibleTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\TypedMonoBehaviour.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\UniRxSynchronizationContext.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\UnityEqualityComparer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\UnityEventExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\UnityGraphicExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\UnityUIComponentExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityEngineBridge\YieldInstructionCache.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityWinRTBridge\Thread.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\UniRx\Scripts\UnityWinRTBridge\ThreadPoolScheduler_UnityWinRT.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\ComboBox\ComboBoxChanged.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\Cooldown\CooldownEffect_Image.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\Cooldown\CooldownEffect_SAUIM.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\01_Basic\Example01CellDto.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\01_Basic\Example01Scene.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\01_Basic\Example01ScrollView.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\01_Basic\Example01ScrollViewCell.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\02_CellEventHandling\Example02CellDto.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\02_CellEventHandling\Example02Scene.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\02_CellEventHandling\Example02ScrollView.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\02_CellEventHandling\Example02ScrollViewCell.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\02_CellEventHandling\Example02ScrollViewContext.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\03_InfiniteScroll\Example03CellDto.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\03_InfiniteScroll\Example03Scene.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\03_InfiniteScroll\Example03ScrollView.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\03_InfiniteScroll\Example03ScrollViewCell.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\FancyScrollView\03_InfiniteScroll\Example03ScrollViewContext.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\HSS-VSS-ScrollSnap\PaginationScript.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\HSS-VSS-ScrollSnap\UpdateScrollSnap.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\MenuExample\Scripts\Menus\AwesomeMenu.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\MenuExample\Scripts\Menus\GameMenu.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\MenuExample\Scripts\Menus\MainMenu.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\MenuExample\Scripts\Menus\OptionsMenu.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\MenuExample\Scripts\Menus\PauseMenu.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\RadialSlider\UpdateRadialValue.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\TextEffects\AnimateEffects.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\TextEffects\testHref.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\UILineRenderer\LineRendererOrbit.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\UILineRenderer\TestAddingPoints.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Examples\UIVerticalScrollerDemo\Scripts\ScrollingCalendar.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\Accordion\Accordion.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\Accordion\AccordionElement.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\Accordion\Tweening\FloatTween.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\Accordion\Tweening\ITweenValue.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\Accordion\Tweening\TweenRunner.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\BoxSlider.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\ColorImage.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\ColorLabel.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\ColorPickerControl.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\ColorPickerPresets.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\ColorPickerTester.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\ColorSlider.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\ColorSliderImage.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\ColorValues.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\Events\ColorChangedEvent.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\Events\HSVChangedEvent.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\HexColorField.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\HSVUtil.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\SVBoxSlider.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ColorPicker\TiltWindow.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ComboBox\AutoCompleteComboBox.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ComboBox\ComboBox.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ComboBox\DropDownList.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ComboBox\DropDownListButton.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ComboBox\DropDownListItem.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\CooldownButton.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\InputFocus.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\MultiTouchScrollRect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\RadialSlider.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ReorderableList\ReorderableList.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ReorderableList\ReorderableListContent.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ReorderableList\ReorderableListDebug.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\ReorderableList\ReorderableListElement.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\RescalingPanels\RescaleDragPanel.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\RescalingPanels\RescalePanel.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\RescalingPanels\ResizePanel.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\SegmentedControl.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\SelectionBox\ExampleSelectable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\SelectionBox\IBoxSelectable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\SelectionBox\SelectionBox.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\Stepper.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\TextPic.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Controls\UI_Knob.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\BestFitOutline.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\CurlyUI\CUIBezierCurve.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\CurlyUI\CUIGraphic.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\CurlyUI\CUIImage.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\CurlyUI\CUIMisc.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\CurlyUI\CUIText.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\CurvedText.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\CylinderText.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\Gradient.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\Gradient2.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\LetterSpacing.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\MonoSpacing.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\NicerOutline.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\RaycastMask.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\ShaderEffects\UIAdditiveEffect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\ShaderEffects\UIImageCrop.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\ShaderEffects\UILinearDodgeEffect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\ShaderEffects\UIMultiplyEffect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\ShaderEffects\UIScreenEffect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\ShaderEffects\UISoftAdditiveEffect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\ShineEffect.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\ShineEffector.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\SoftMaskScript.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\UIFlippable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Effects\UIParticleSystem.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\InputModules\AimerInputModule.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\InputModules\GamePadInputModule.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\CurvedLayout.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\FancyScrollView.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\FancyScrollViewCell.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\FlowLayoutGroup.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\HorizontalScrollSnap.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\IScrollSnap.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\RadialLayout.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\ScrollPositionController.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\ScrollSnap.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\ScrollSnapBase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\ScrollSnapScrollbarHelper.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\TableLayoutGroup.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\TileSizeFitter.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\UIVerticalScroller.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Layout\VerticalScrollSnap.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\MenuSystem\Menu.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\MenuSystem\MenuManager.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\MenuSystem\SimpleMenu.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Primitives\DiamondGraph.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Primitives\UICircle.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Primitives\UICornerCut.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Primitives\UIGridRenderer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Primitives\UILineRenderer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Primitives\UILineTextureRenderer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Primitives\UIPolygon.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Primitives\UIPrimitiveBase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\TabNavigationHelper.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\ToolTips\BoundTooltip\BoundTooltipItem.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\ToolTips\BoundTooltip\BoundTooltipTrigger.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\ToolTips\HoverTooltip.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\ToolTips\ToolTip.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\UIWindowBase.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\BezierPath.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\CableCurve.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\Circle.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\CLZF2.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\DragCorrector.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ExtensionsToggle.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ExtensionsToggleGroup.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\InputFieldEnterSubmit.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\NonDrawingGraphic.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\PaginationManager.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\PPIViewer.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ReadOnlyAttribute.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ReturnKeyTriggersButton.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ScrollConflictManager.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ScrollRectEx.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ScrollRectExtensions.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ScrollRectLinker.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\ScrollRectTweener.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\SelectableScaler.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\SetPropertyUtility.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\switchToRectTransform.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\TestCompression.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UI_InfiniteScroll.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UI_ScrollRectOcclusion.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UI_TweenScale.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UIExtensionMethods.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UIHighlightable.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UILineConnector.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UIScrollToSelection.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UIScrollToSelectionXY.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\Utilities\UISelectableExtension.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\VR Extensions\VRCursor.cs" />
|
||||
<Compile Include="Assets\Scripts\NIH\unity-ui-extensions\Scripts\VR Extensions\VRInputModule.cs" />
|
||||
<Compile Include="Assets\Scripts\Orbit.cs" />
|
||||
<Compile Include="Assets\Scripts\PropertiesPanel.cs" />
|
||||
<Compile Include="Assets\Scripts\Prototype.cs" />
|
||||
<Compile Include="Assets\Scripts\ZoneManager.cs" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UIAdditive.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle AddSmooth.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle Premultiply Blend.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UISoftAdditive.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UIParticleHidden.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\SoftMaskShader.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle Add.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle Multiply.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle Alpha Blend.shader" />
|
||||
<None Include="Assets\Shaders\CubicPulseBrush.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UIImageCrop.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UILinearDodge.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle VertexLit Blended.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle AddMultiply.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle Blend.shader" />
|
||||
<None Include="Assets\Scripts\NIH\UniRx\ReadMe.txt" />
|
||||
<None Include="Assets\Shaders\Isolines.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UIMultiply.shader" />
|
||||
<None Include="Assets\Scripts\NIH\LinqFaster\readme.txt" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UIScreen.shader" />
|
||||
<None Include="Assets\Scripts\NIH\unity-ui-extensions\Shaders\UI Particle MultiplyDouble.shader" />
|
||||
<Reference Include="Unity.TextMeshPro.Editor">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll</HintPath>
|
||||
</Reference>
|
||||
|
|
@ -73,6 +589,12 @@
|
|||
<Reference Include="Unity.TextMeshPro">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.TextMeshPro.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Mathematics">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.Mathematics.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Mathematics.Editor">
|
||||
<HintPath>C:/Users/rwvens/Documents/GitHub/Aetheria-Economy/Library/ScriptAssemblies/Unity.Mathematics.Editor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UnityEngine.AIModule">
|
||||
<HintPath>C:/Program Files/Unity/Hub/Editor/2018.4.17f1/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
|
||||
</Reference>
|
||||
|
|
@ -651,6 +1173,10 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="Economy.Shared.Unity.csproj">
|
||||
<Project>{A62B36C2-E9DE-B992-0779-F5FCF5968986}</Project>
|
||||
<Name>Economy.Shared.Unity</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="MagicOnion.csproj">
|
||||
<Project>{8646472B-6F4E-DCCA-A987-99E48366FF7F}</Project>
|
||||
<Name>MagicOnion</Name>
|
||||
|
|
@ -667,10 +1193,6 @@
|
|||
<Project>{21EF11C5-27DC-3D88-B027-9A4B6F36BAE4}</Project>
|
||||
<Name>MessagePack</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="Economy.Shared.Unity.csproj">
|
||||
<Project>{A62B36C2-E9DE-B992-0779-F5FCF5968986}</Project>
|
||||
<Name>Economy.Shared.Unity</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
|
|
|||
25
Assets/Scripts/ColorButton.cs
Normal file
25
Assets/Scripts/ColorButton.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using UnityEngine.UI.Extensions.ColorPicker;
|
||||
|
||||
public class ColorButton : MonoBehaviour {
|
||||
public ColorChangedEvent OnColorChanged = new ColorChangedEvent();
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
var colorPicker = transform.root.GetComponentInChildren<ColorPickerControl>(true);
|
||||
var image = GetComponent<Image>();
|
||||
GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
colorPicker.gameObject.SetActive(true);
|
||||
colorPicker.CurrentColor = image.color;
|
||||
colorPicker.onValueChanged.AddListener(col =>
|
||||
{
|
||||
image.color = col;
|
||||
OnColorChanged.Invoke(col);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/ColorButton.cs.meta
Normal file
11
Assets/Scripts/ColorButton.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 017a6733a6cd4ee4b99d7c53f15d21da
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
145
Assets/Scripts/Database.cs
Normal file
145
Assets/Scripts/Database.cs
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MessagePack;
|
||||
using UniRx;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoad]
|
||||
#endif
|
||||
public class Database
|
||||
{
|
||||
public static event Action OnDataUpdate;
|
||||
|
||||
private static Dictionary<Guid, IDatabaseEntry> Entries = new Dictionary<Guid, IDatabaseEntry>();
|
||||
|
||||
private static Dictionary<Type, Dictionary<Guid, IDatabaseEntry>> Types = new Dictionary<Type, Dictionary<Guid, IDatabaseEntry>>();
|
||||
|
||||
private static DirectoryInfo _dir;
|
||||
|
||||
private static IDatabaseEntry Load(string path)
|
||||
{
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
// Debug.Log("Deserializing item: \n" + MessagePackSerializer.ToJson(bytes));
|
||||
try
|
||||
{
|
||||
var entry = MessagePackSerializer.Deserialize<IDatabaseEntry>(bytes);
|
||||
if (entry != null)
|
||||
{
|
||||
Entries[entry.GetId()] = entry;
|
||||
var type = entry.GetType();
|
||||
var types = type.FindInterfaces((_, __) => true, null).Append(type);
|
||||
foreach (var t in types)
|
||||
{
|
||||
if(!Types.ContainsKey(t))
|
||||
Types[t] = new Dictionary<Guid, IDatabaseEntry>();
|
||||
Types[t][entry.GetId()] = entry;
|
||||
}
|
||||
OnDataUpdate?.Invoke();
|
||||
}
|
||||
|
||||
return entry;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Log($"Encountered exception while reading item {path.Split('\\').Last()}:\n{MessagePackSerializer.SerializeToJson(bytes)}\n{e.StackTrace}");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<IDatabaseEntry> AllEntries => Entries.Values;
|
||||
|
||||
public static IDatabaseEntry Get(Guid guid)
|
||||
{
|
||||
IDatabaseEntry entry;
|
||||
Entries.TryGetValue(guid, out entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
public static T Get<T>(Guid guid) where T : IDatabaseEntry
|
||||
{
|
||||
IDatabaseEntry entry;
|
||||
Types[typeof(T)].TryGetValue(guid, out entry);
|
||||
return (T) entry;
|
||||
}
|
||||
|
||||
public static IEnumerable<T> GetAll<T>()
|
||||
{
|
||||
return Types[typeof(T)].Values.Cast<T>();
|
||||
}
|
||||
|
||||
public static void Save(IDatabaseEntry entry)
|
||||
{
|
||||
// Debug.Log("Serializing item: \n" + item.ToJson());
|
||||
var dir = new DirectoryInfo(Path.Combine(_dir.FullName, entry.GetType().Name));
|
||||
if(!dir.Exists)
|
||||
dir.Create();
|
||||
File.WriteAllBytes(Path.Combine(dir.FullName, entry.GetId().ToString()), entry.Serialize());
|
||||
}
|
||||
|
||||
public static void Duplicate(IDatabaseEntry entry)
|
||||
{
|
||||
var oldID = entry.Entry.ID;
|
||||
entry.Entry.ID = Guid.NewGuid();
|
||||
Save(entry);
|
||||
var dir = new DirectoryInfo(Path.Combine(_dir.FullName, entry.GetType().Name));
|
||||
Load(Path.Combine(dir.FullName, oldID.ToString()));
|
||||
}
|
||||
|
||||
public static void SaveAll()
|
||||
{
|
||||
foreach (var entry in GetAll<IDatabaseEntry>())
|
||||
{
|
||||
Save(entry);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Delete(IDatabaseEntry entry)
|
||||
{
|
||||
var dir = new DirectoryInfo(Path.Combine(_dir.FullName, entry.GetType().Name));
|
||||
File.Delete(Path.Combine(dir.FullName,entry.GetId().ToString()));
|
||||
}
|
||||
|
||||
static Database()
|
||||
{
|
||||
_dir = new DirectoryInfo(Application.dataPath).Parent.CreateSubdirectory("GameData");
|
||||
|
||||
Action<string> update = path => Load(path);
|
||||
|
||||
foreach (var file in Directory.GetFiles(_dir.FullName, "*.*", SearchOption.AllDirectories))
|
||||
update(file);
|
||||
|
||||
var watcher = new FileSystemWatcher(_dir.FullName);
|
||||
watcher.IncludeSubdirectories = true;
|
||||
watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName;
|
||||
watcher.Changed += (_, args) => MainThreadDispatcher.Post(__ => update(args.FullPath), null);
|
||||
watcher.Created += (_, args) => MainThreadDispatcher.Post(__ => update(args.FullPath), null);
|
||||
watcher.Deleted += (_, args) => MainThreadDispatcher.Post(__ =>
|
||||
{
|
||||
var entryGuid = Guid.Parse(args.Name.Split('\\').Last());
|
||||
foreach (var entries in Types.Values)
|
||||
entries.Remove(entryGuid);
|
||||
Entries.Remove(entryGuid);
|
||||
OnDataUpdate?.Invoke();
|
||||
}, null);
|
||||
watcher.EnableRaisingEvents = true;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IDatabaseEntry
|
||||
{
|
||||
DatabaseEntry Entry { get; }
|
||||
}
|
||||
|
||||
[Inspectable]
|
||||
[MessagePackObject]
|
||||
public class DatabaseEntry
|
||||
{
|
||||
[Key("id")] public Guid ID = Guid.NewGuid();
|
||||
[Inspectable] [Key("name")] public string Name;
|
||||
[Inspectable] [Key("description")] public string Description;
|
||||
}
|
||||
11
Assets/Scripts/Database.cs.meta
Normal file
11
Assets/Scripts/Database.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a43b39c6991618b43aed4a24ffcdc0ff
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
99
Assets/Scripts/Extensions.cs
Normal file
99
Assets/Scripts/Extensions.cs
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using MessagePack;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
public static class Extensions
|
||||
{
|
||||
public static void BroadcastMessageExt<T>(this GameObject go, string methodName, object value = null, SendMessageOptions options = SendMessageOptions.RequireReceiver)
|
||||
{
|
||||
var monoList = new List<T>();
|
||||
go.GetComponentsInChildren(true, monoList);
|
||||
foreach (var component in monoList)
|
||||
{
|
||||
try
|
||||
{
|
||||
Type type = component.GetType();
|
||||
|
||||
MethodInfo method = type.GetMethod(methodName, BindingFlags.Instance |
|
||||
BindingFlags.NonPublic |
|
||||
BindingFlags.Public |
|
||||
BindingFlags.Static);
|
||||
|
||||
method.Invoke(component, new[] { value });
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//Re-create the Error thrown by the original SendMessage function
|
||||
if (options == SendMessageOptions.RequireReceiver)
|
||||
Debug.LogError("SendMessage " + methodName + " has no receiver!");
|
||||
|
||||
//Debug.LogError(e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsDefault<T>(this T value) where T : struct
|
||||
{
|
||||
bool isDefault = value.Equals(default(T));
|
||||
|
||||
return isDefault;
|
||||
}
|
||||
|
||||
public static Texture2D ToTexture(this Color c)
|
||||
{
|
||||
Texture2D result = new Texture2D(1, 1);
|
||||
result.SetPixels(new[]{c});
|
||||
result.Apply();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Vector2 Flatland(this Vector3 v)
|
||||
{
|
||||
return new Vector2(v.x, v.z);
|
||||
}
|
||||
|
||||
public static Vector3 Flatland(this Vector2 v)
|
||||
{
|
||||
return new Vector3(v.x, 0, v.y);
|
||||
}
|
||||
|
||||
public static string SplitCamelCase( this string str )
|
||||
{
|
||||
return Regex.Replace(
|
||||
Regex.Replace(
|
||||
str,
|
||||
@"(\P{Ll})(\P{Ll}\p{Ll})",
|
||||
"$1 $2"
|
||||
),
|
||||
@"(\p{Ll})(\P{Ll})",
|
||||
"$1 $2"
|
||||
);
|
||||
}
|
||||
|
||||
public static T RandomElement<T>(this IEnumerable<T> enumerable) => enumerable.ElementAt(Random.Range(0, enumerable.Count()));
|
||||
|
||||
public static float2 ToFloat2(this Vector2 v) => new float2(v.x, v.y);
|
||||
public static float3 ToFloat3(this Vector3 v) => new float3(v.x, v.y, v.z);
|
||||
public static Vector2 ToVector2(this float2 v) => new Vector2(v.x, v.y);
|
||||
public static Vector3 ToVector3(this float3 v) => new Vector3(v.x, v.y, v.z);
|
||||
|
||||
public static IDatabaseEntry Get(this Guid entry) => Database.Get(entry);
|
||||
public static T Get<T>(this Guid entry) where T : class, IDatabaseEntry => Database.Get(entry) as T;
|
||||
public static Guid GetId(this IDatabaseEntry entry) => entry.Entry.ID;
|
||||
public static string ToJson(this IDatabaseEntry entry) => MessagePackSerializer.SerializeToJson(entry);
|
||||
public static byte[] Serialize(this IDatabaseEntry entry) => MessagePackSerializer.Serialize(entry);
|
||||
|
||||
public static bool IsImplementationOf(this Type baseType, Type interfaceType)
|
||||
{
|
||||
return baseType.GetInterfaces().Any(interfaceType.Equals);
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/Scripts/Extensions.cs.meta
Normal file
11
Assets/Scripts/Extensions.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 187eed4f0b5d7034aac5f16dbfccb14d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
246
Assets/Scripts/Galaxy.cs
Normal file
246
Assets/Scripts/Galaxy.cs
Normal file
|
|
@ -0,0 +1,246 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
//using MessagePack;
|
||||
using UnityEngine;
|
||||
using NaughtyAttributes;
|
||||
using JM.LinqFaster;
|
||||
|
||||
[CreateAssetMenu(menuName = "Aetheria/Galaxy")]
|
||||
public class Galaxy : ScriptableObject
|
||||
{
|
||||
public GalaxyMapData MapData;
|
||||
public List<ContinentData> NameDatabase;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class GalaxyMapData
|
||||
{
|
||||
public int Arms = 4;
|
||||
public float Twist = 10;
|
||||
public float TwistPower = 2;
|
||||
|
||||
[HideInInspector]
|
||||
public GalaxyMapLayerData StarDensity;
|
||||
[HideInInspector]
|
||||
public List<GalaxyMapLayerData> CultureDensities = new List<GalaxyMapLayerData>();
|
||||
//[HideInInspector]
|
||||
public List<StarData> Stars = new List<StarData>();
|
||||
}
|
||||
|
||||
public static class StarListExtensions
|
||||
{
|
||||
class DijkstraStar
|
||||
{
|
||||
public float Cost;
|
||||
public DijkstraStar Parent;
|
||||
public StarData Star;
|
||||
}
|
||||
|
||||
public static List<StarData> FindPath(this List<StarData> stars, StarData source, StarData target, bool bestFirst = false)
|
||||
{
|
||||
SortedList<float,DijkstraStar> members = new SortedList<float,DijkstraStar>{{0,new DijkstraStar{Star = source}}};
|
||||
List<DijkstraStar> searched = new List<DijkstraStar>();
|
||||
while (true)
|
||||
{
|
||||
var s = members.FirstOrDefault(m => !searched.Contains(m.Value)).Value; // Lowest cost unsearched node
|
||||
if (s == null) return null; // No vertices left unsearched
|
||||
if (s.Star == target) // We found the path
|
||||
{
|
||||
Stack<DijkstraStar> path = new Stack<DijkstraStar>(); // Since we start at the end, use a LIFO collection
|
||||
path.Push(s);
|
||||
while(path.Peek().Parent!=null) // Keep pushing until we reach the start, which has no parent
|
||||
path.Push(path.Peek().Parent);
|
||||
return path.Select(dv => dv.Star).ToList();
|
||||
}
|
||||
// foreach (var dijkstraStar in s.Star.Links.Select(i => stars[i]) // All adjacent stars
|
||||
// .Where(n => members.All(m => m.Value.Star != n)) // That are not members
|
||||
// .Select(n => new DijkstraStar {Parent = s, Star = n, Cost = s.Cost + (s.Star.Position - n.Position).magnitude}))
|
||||
// For each adjacent star (filter already visited stars unless heuristic is in use)
|
||||
foreach (var dijkstraStar in s.Star.Links.WhereSelectF(i => !bestFirst || members.All(m => m.Value.Star != stars[i]),
|
||||
// Cost is parent cost plus distance
|
||||
i => new DijkstraStar {Parent = s, Star = stars[i], Cost = s.Cost + (s.Star.Position - stars[i].Position).magnitude}))
|
||||
// Add new member to list, sorted by cost plus optional heuristic
|
||||
members.Add(bestFirst ? dijkstraStar.Cost + (dijkstraStar.Star.Position - target.Position).magnitude : dijkstraStar.Cost, dijkstraStar);
|
||||
searched.Add(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class StarData
|
||||
{
|
||||
public Vector2 Position;
|
||||
public List<int> Links = new List<int>();
|
||||
public string NameSource;
|
||||
public List<string> Names = new List<string>();
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class GalaxyMapLayerData
|
||||
{
|
||||
public float CoreBoost = 1.05f;
|
||||
public float CoreBoostOffset = .1f;
|
||||
public float CoreBoostPower = 2.25f;
|
||||
public float EdgeReduction = 3;
|
||||
public float NoiseOffset = 0;
|
||||
public float NoiseAmplitude = 1.5f;
|
||||
public float NoiseGain = .7f;
|
||||
public float NoiseLacunarity = 2;
|
||||
public int NoiseOctaves = 7;
|
||||
public float NoiseFrequency = 1;
|
||||
public int NoiseSeed = 1337;
|
||||
|
||||
private FastNoise _noise = new FastNoise();
|
||||
|
||||
public float Evaluate(Vector2 uv, GalaxyMapData galaxy)
|
||||
{
|
||||
_noise.SetFractalGain(NoiseGain);
|
||||
_noise.SetFractalLacunarity(NoiseLacunarity);
|
||||
_noise.SetFractalOctaves(NoiseOctaves);
|
||||
_noise.SetFrequency(NoiseFrequency);
|
||||
_noise.SetSeed(NoiseSeed);
|
||||
|
||||
Func<Vector2, Vector2> offset = v => Vector2.one / 2 - v;
|
||||
Func<Vector2, float> circle = v => (.5f - v.magnitude) * 2;
|
||||
Func<Vector2, Vector2> twist = v => v.Rotate(Mathf.Pow(v.magnitude*2,galaxy.TwistPower)*galaxy.Twist);
|
||||
Func<Vector2, float> spokes = v => Mathf.Sin(Mathf.Atan2(-v.y,v.x)*galaxy.Arms);
|
||||
var c = circle(offset(uv));
|
||||
return Mathf.Clamp01((Mathf.Lerp(spokes(twist(offset(uv))) - EdgeReduction * offset(uv).magnitude, 1,
|
||||
Mathf.Pow(c + CoreBoostOffset, CoreBoostPower) * CoreBoost) - (_noise.GetPerlin(uv.x,uv.y)+NoiseOffset) * NoiseAmplitude) * Mathf.Clamp01(c));
|
||||
}
|
||||
}
|
||||
|
||||
public static class Vector2Extension {
|
||||
|
||||
public static Vector2 Rotate(this Vector2 v, float degrees) {
|
||||
float sin = Mathf.Sin(degrees * Mathf.Deg2Rad);
|
||||
float cos = Mathf.Cos(degrees * Mathf.Deg2Rad);
|
||||
|
||||
float tx = v.x;
|
||||
float ty = v.y;
|
||||
v.x = (cos * tx) - (sin * ty);
|
||||
v.y = (sin * tx) + (cos * ty);
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class NameData
|
||||
{
|
||||
public Dictionary<string, Dictionary<string, List<string>>> Names = new Dictionary<string, Dictionary<string, List<string>>>();
|
||||
|
||||
public void Add(string dataString)
|
||||
{
|
||||
//Debug.Log("Adding " + dataString);
|
||||
var all = dataString.Split(',');
|
||||
var name = all[0].Split(" -.".ToCharArray(),StringSplitOptions.RemoveEmptyEntries).OrderByDescending(s=>s.Length).First();
|
||||
var region = all[1].Split('/');
|
||||
var continent = region[0];
|
||||
var capital = region[1];
|
||||
if(!Names.ContainsKey(continent))
|
||||
Names[continent] = new Dictionary<string, List<string>>();
|
||||
if(!Names[continent].ContainsKey(capital))
|
||||
Names[continent][capital] = new List<string>();
|
||||
Names[continent][capital].Add(name);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ContinentData
|
||||
{
|
||||
public string Name;
|
||||
public List<RegionData> Regions;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class RegionData
|
||||
{
|
||||
public string Name;
|
||||
public List<string> Towns;
|
||||
}
|
||||
|
||||
public class VoronoiLink
|
||||
{
|
||||
public Vertex2 point1;
|
||||
public Vertex2 point2;
|
||||
|
||||
public float Length { get { return (point1.ToVector2() - point2.ToVector2()).magnitude; } }
|
||||
|
||||
public VoronoiLink(Vertex2 p1, Vertex2 p2)
|
||||
{
|
||||
point1 = p1;
|
||||
point2 = p2;
|
||||
}
|
||||
|
||||
public bool ContainsPoint(Vertex2 p)
|
||||
{
|
||||
return point1 == p || point2 == p;
|
||||
}
|
||||
}
|
||||
|
||||
public static class VoronoiLinkExtensions
|
||||
{
|
||||
class DijkstraVertex
|
||||
{
|
||||
public double Cost;
|
||||
public double Heuristic;
|
||||
public DijkstraVertex Parent;
|
||||
public Vertex2 Vertex;
|
||||
}
|
||||
|
||||
public static bool ContainsLine(this IEnumerable<VoronoiLink> data, VoronoiLink l)
|
||||
{
|
||||
return
|
||||
data.Any(
|
||||
line =>
|
||||
(line.point1 == l.point1 && line.point2 == l.point2) ||
|
||||
(line.point1 == l.point2 && line.point2 == l.point1));
|
||||
}
|
||||
|
||||
public static IEnumerable<Vertex2> FindPath(this IEnumerable<VoronoiLink> data, Vertex2 source, Vertex2 target, bool bestFirst = true)
|
||||
{
|
||||
List<DijkstraVertex> members = new List<DijkstraVertex>{new DijkstraVertex{Vertex = source}};
|
||||
List<Vertex2> searched = new List<Vertex2>();
|
||||
while (true)
|
||||
{
|
||||
var v = members.Where(m=>!searched.Contains(m.Vertex)).OrderBy(m=>bestFirst?m.Heuristic:m.Cost).FirstOrDefault();
|
||||
if (v == null) return null; // No vertices left unsearched
|
||||
if (v.Vertex == target)
|
||||
{
|
||||
Stack<DijkstraVertex> path = new Stack<DijkstraVertex>();
|
||||
path.Push(v);
|
||||
while(path.Peek().Parent!=null)
|
||||
path.Push(path.Peek().Parent);
|
||||
return path.Select(dv => dv.Vertex).ToList();
|
||||
}
|
||||
members.AddRange(data.Where(l => l.point1 == v.Vertex).Select(l => l.point2).Concat(data.Where(l => l.point2 == v.Vertex).Select(l => l.point1))
|
||||
.Where(n => members.All(m => m.Vertex != n)).Select(n =>
|
||||
{
|
||||
var c = new DijkstraVertex {Parent = v, Vertex = n, Cost = v.Cost + v.Vertex.Distance(n)};
|
||||
if (bestFirst)
|
||||
c.Heuristic = c.Cost + c.Vertex.Distance(target);
|
||||
return c;
|
||||
}));
|
||||
searched.Add(v.Vertex);
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<Vertex2> ConnectedRegion(this IEnumerable<VoronoiLink> data, Vertex2 v)
|
||||
{
|
||||
List<Vertex2> members = new List<Vertex2>();
|
||||
members.Add(v);
|
||||
while (true)
|
||||
{
|
||||
int lastCount = members.Count;
|
||||
// For each member, add all vertices that are connected to it via a line but are not already a member
|
||||
foreach (Vertex2 m in members.ToArray())
|
||||
members.AddRange(data.Where(l => l.point1 == m).Select(l => l.point2).Concat(data.Where(l => l.point2 == m).Select(l => l.point1))
|
||||
.Where(n => !members.Contains(n)));
|
||||
// If we have stopped finding neighbors, stop traversing
|
||||
if (members.Count == lastCount)
|
||||
return members;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Galaxy.cs.meta
Normal file
11
Assets/Scripts/Galaxy.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a17905e2bcacd37408f3f6e93b9885e9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Scripts/NIH.meta
Normal file
8
Assets/Scripts/NIH.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ec3325b6b8b1a504b8de9e3553bce449
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
2368
Assets/Scripts/NIH/FastNoise.cs
Normal file
2368
Assets/Scripts/NIH/FastNoise.cs
Normal file
File diff suppressed because it is too large
Load diff
11
Assets/Scripts/NIH/FastNoise.cs.meta
Normal file
11
Assets/Scripts/NIH/FastNoise.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 53b469b8da6bd4e4bb62cb13d1ce301d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Scripts/NIH/LinqFaster.meta
Normal file
8
Assets/Scripts/NIH/LinqFaster.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f577b52edee2c39429e13166dc0fddc2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
207
Assets/Scripts/NIH/LinqFaster/Aggregate.cs
Normal file
207
Assets/Scripts/NIH/LinqFaster/Aggregate.cs
Normal file
|
|
@ -0,0 +1,207 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides faster array and list specific extension methods with
|
||||
/// the same semantics as the Linq extensions methods.
|
||||
/// </summary>
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
// ------------------------------ Arrays --------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Applies an accumulator function over an array.
|
||||
/// </summary>
|
||||
/// <param name="source">An array to aggregate over.</param>
|
||||
/// <param name="func">An accumulator function to be invoked on each element</param>
|
||||
/// <returns>The final accumulator value</returns>
|
||||
public static TSource AggregateF<TSource>(this TSource[] source, Func<TSource, TSource, TSource> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
TSource result = source[0];
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
result = func(result, source[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies an accumulator function over an array. The specified seed
|
||||
/// value is used as the initial accumulator value.
|
||||
/// </summary>
|
||||
/// <param name="source">An array to aggregate over.</param>
|
||||
/// <param name="seed">The initial accumulator value.</param>
|
||||
/// <param name="func">An accumulator function to be invoked on each element</param>
|
||||
/// <returns>The final accumulator value</returns>
|
||||
public static TAccumulate AggregateF<TSource, TAccumulate>(this TSource[] source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
TAccumulate result = seed;
|
||||
foreach (var v in source)
|
||||
{
|
||||
result = func(result, v);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies an accumulator function over an array. The specified seed
|
||||
/// value is used as the initial accumulator value, and the specified
|
||||
/// function is used to select the result value.
|
||||
/// </summary>
|
||||
/// <param name="source">An array to aggregate over.</param>
|
||||
/// <param name="seed">The initial accumulator value.</param>
|
||||
/// <param name="func">An accumulator function to be invoked on each element</param>
|
||||
/// <param name="resultSelector">A function to transform the final accumulator value into the result value.</param>
|
||||
/// <returns>The transformed final accumulator value</returns>
|
||||
public static TResult AggregateF<TSource, TAccumulate, TResult>(this TSource[] source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
if (resultSelector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("resultSelector");
|
||||
}
|
||||
|
||||
TAccumulate result = seed;
|
||||
foreach (var v in source)
|
||||
{
|
||||
result = func(result, v);
|
||||
}
|
||||
return resultSelector(result);
|
||||
}
|
||||
|
||||
// ------------------------------ Lists --------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Applies an accumulator function over a List.
|
||||
/// </summary>
|
||||
/// <typeparam name="TSource"></typeparam>
|
||||
/// <param name="source">A List to aggregate over.</param>
|
||||
/// <param name="func">An accumulator function to be invoked on each element</param>
|
||||
/// <returns>The final accumulator value</returns>
|
||||
public static TSource AggregateF<TSource>(this List<TSource> source, Func<TSource, TSource, TSource> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
TSource result = source[0];
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
result = func(result, source[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies an accumulator function over a List. The specified seed
|
||||
/// value is used as the initial accumulator value.
|
||||
/// </summary>
|
||||
/// <param name="source">A List to aggregate over.</param>
|
||||
/// <param name="seed">The initial accumulator value.</param>
|
||||
/// <param name="func">An accumulator function to be invoked on each element</param>
|
||||
/// <returns>The final accumulator value</returns>
|
||||
public static TAccumulate AggregateF<TSource, TAccumulate>(this List<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
TAccumulate result = seed;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
result = func(result, source[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies an accumulator function over a List. The specified seed
|
||||
/// value is used as the initial accumulator value, and the specified
|
||||
/// function is used to select the result value.
|
||||
/// </summary>
|
||||
/// <param name="source">A List to aggregate over.</param>
|
||||
/// <param name="seed">The initial accumulator value.</param>
|
||||
/// <param name="func">An accumulator function to be invoked on each element</param>
|
||||
/// <param name="resultSelector">A function to transform the final accumulator value into the result value.</param>
|
||||
/// <returns>The transformed final accumulator value</returns>
|
||||
public static TResult AggregateF<TSource, TAccumulate, TResult>(this List<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
if (resultSelector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("resultSelector");
|
||||
}
|
||||
|
||||
TAccumulate result = seed;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
result = func(result, source[i]);
|
||||
}
|
||||
return resultSelector(result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Aggregate.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Aggregate.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c982561dda0276f48b28c8fa12295ad4
|
||||
timeCreated: 1518622478
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
133
Assets/Scripts/NIH/LinqFaster/AnyAll.cs
Normal file
133
Assets/Scripts/NIH/LinqFaster/AnyAll.cs
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether an array contains any elements
|
||||
/// </summary>
|
||||
/// <param name="source">The array to check for emptiness</param>
|
||||
/// <returns>true if the source array contains any elements, otherwise, false/</returns>
|
||||
public static bool AnyF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
return source.Length > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether any element of an array satifies a condition.
|
||||
/// </summary>
|
||||
/// <param name="source">An array whose elements to apply the predicate to.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>true if any elements in the source array pass the test in the specified predicate; otherwise, false.</returns>
|
||||
public static bool AnyF<TSource>(this TSource[] source, Predicate<TSource> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
return Array.Exists(source, predicate);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether all elements of an array satisfy a condition.
|
||||
/// </summary>
|
||||
/// <param name="source">An array that contains the elements to apply the predicate to.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>true if every element of the source array passes the test in the specified
|
||||
/// predicate, or if the array is empty; otherwise, false</returns>
|
||||
public static bool AllF<TSource>(this TSource[] source, Predicate<TSource> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
return Array.TrueForAll(source, predicate);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// -------------------------- Lists --------------------------------------------
|
||||
/// <summary>
|
||||
/// Determines whether a list contains any elements
|
||||
/// </summary>
|
||||
/// <param name="source">The list to check for emptiness</param>
|
||||
/// <returns>true if the source list contains any elements, otherwise, false/</returns>
|
||||
public static bool AnyF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
return source.Count > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether any element of an array satifies a condition.
|
||||
/// </summary>
|
||||
/// <param name="source">An array whose elements to apply the predicate to.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>true if any elements in the source array pass the test in the specified predicate; otherwise, false.</returns>
|
||||
public static bool AnyF<TSource>(this List<TSource> source, Predicate<TSource> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
return source.Exists(predicate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether all elements of a list satisfy a condition.
|
||||
/// </summary>
|
||||
/// <param name="source">A list that contains the elements to apply the predicate to.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>true if every element of the source array passes the test in the specified
|
||||
/// predicate, or if the list is empty; otherwise, false</returns>
|
||||
public static bool AllF<TSource>(this List<TSource> source, Predicate<TSource> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
return source.TrueForAll(predicate);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/AnyAll.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/AnyAll.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0f33f6b80d5e4d24bb1f5b42a26585e8
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
633
Assets/Scripts/NIH/LinqFaster/Average.cs
Normal file
633
Assets/Scripts/NIH/LinqFaster/Average.cs
Normal file
|
|
@ -0,0 +1,633 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of an array
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the average of.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF(this int[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
}
|
||||
return (double)sum / source.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF<T>(this T[] source, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
}
|
||||
return (double)sum / source.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of an array
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the average of.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF(this long[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
}
|
||||
return (double)sum / source.Length;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF<T>(this T[] source, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
}
|
||||
return (double)sum / source.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of an array
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the average of.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static float AverageF(this float[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return (float)(sum / source.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static float AverageF<T>(this T[] source, Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return (float)(sum / source.Length);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of an array
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the average of.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF(this double[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return sum / source.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF<T>(this T[] source, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return sum / source.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of an array
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the average of.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static decimal AverageF(this decimal[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
decimal sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return sum / source.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static decimal AverageF<T>(this T[] source, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
|
||||
decimal sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return sum / source.Length;
|
||||
}
|
||||
|
||||
// -------------------------- Lists --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of a list.
|
||||
/// </summary>
|
||||
/// <param name="source">The list to calculate the average of.</param>
|
||||
/// <returns>The average of the list.</returns>
|
||||
public static double AverageF(this List<int> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
}
|
||||
return (double)sum / source.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF<T>(this List<T> source, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
}
|
||||
return (double)sum / source.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of a list.
|
||||
/// </summary>
|
||||
/// <param name="source">The list to calculate the average of.</param>
|
||||
/// <returns>The average of the list.</returns>
|
||||
public static double AverageF(this List<long> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
}
|
||||
return (double)sum / source.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF<T>(this List<T> source, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
}
|
||||
return (double)sum / source.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of a list.
|
||||
/// </summary>
|
||||
/// <param name="source">The list to calculate the average of.</param>
|
||||
/// <returns>The average of the list.</returns>
|
||||
public static float AverageF(this List<float> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return (float)(sum / source.Count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static float AverageF<T>(this List<T> source, Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return (float)(sum / source.Count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of a list.
|
||||
/// </summary>
|
||||
/// <param name="source">The list to calculate the average of.</param>
|
||||
/// <returns>The average of the list.</returns>
|
||||
public static double AverageF(this List<double> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return sum / source.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static double AverageF<T>(this List<T> source, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return sum / source.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of a list.
|
||||
/// </summary>
|
||||
/// <param name="source">The list to calculate the average of.</param>
|
||||
/// <returns>The average of the list.</returns>
|
||||
public static decimal AverageF(this List<decimal> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
decimal sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return sum / source.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Computes the average of values obtained by invoking a transform function on
|
||||
/// each element of the input array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to calculate the transformed average of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The average of the array.</returns>
|
||||
public static decimal AverageF<T>(this List<T> source, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
|
||||
decimal sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return sum / source.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Average.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Average.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 03ad52f1464dca347a72680cef2af96a
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
77
Assets/Scripts/NIH/LinqFaster/Contains.cs
Normal file
77
Assets/Scripts/NIH/LinqFaster/Contains.cs
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether an array contains a specified element by using the
|
||||
/// provided IEqualityComparer.
|
||||
/// </summary>
|
||||
/// <param name="source">An array in which to locate a value.</param>
|
||||
/// <param name="value">The value to locate.</param>
|
||||
/// <param name="comparer">An equality comparer to compare values.</param>
|
||||
/// <returns>true if the source sequence contains an element that has the specified value; otherwise, false.</returns>
|
||||
public static bool ContainsF<TSource>(this TSource[] source, TSource value, IEqualityComparer<TSource> comparer = null)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (comparer == null)
|
||||
{
|
||||
return Array.IndexOf(source, value) != -1;
|
||||
}
|
||||
|
||||
|
||||
foreach (TSource e in source)
|
||||
{
|
||||
if (comparer.Equals(e, value))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// -------------------------- Lists --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether a list contains a specified element by using the
|
||||
/// provided IEqualityComparer.
|
||||
/// </summary>
|
||||
/// <param name="source">A list in which to locate a value.</param>
|
||||
/// <param name="value">The value to locate.</param>
|
||||
/// <param name="comparer">An equality comparer to compare values.</param>
|
||||
/// <returns>true if the source sequence contains an element that has the specified value; otherwise, false.</returns>
|
||||
public static bool ContainsF<TSource>(this List<TSource> source, TSource value, IEqualityComparer<TSource> comparer = null)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (comparer == null)
|
||||
{
|
||||
return source.IndexOf(value) != -1;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (comparer.Equals(source[i], value))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Contains.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Contains.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b2bd3dc5ff6476641a57d43d3692ce23
|
||||
timeCreated: 1518622477
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
86
Assets/Scripts/NIH/LinqFaster/Count.cs
Normal file
86
Assets/Scripts/NIH/LinqFaster/Count.cs
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
// -------------------------- Arrays --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns a number that represents how many elements in the specified
|
||||
/// array satisfy a condition.
|
||||
/// </summary>
|
||||
/// <param name="source">An array that contains elements to be tested and counted.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>A number that represents how many elements in the array satisfy the condition
|
||||
/// in the predicate function.</returns>
|
||||
public static int CountF<T>(this T[] source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
checked
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------ Lists ---------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns a number that represents how many elements in the specified
|
||||
/// list satisfy a condition.
|
||||
/// </summary>
|
||||
/// <param name="source">A list that contains elements to be tested and counted.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>A number that represents how many elements in the list satisfy the condition
|
||||
/// in the predicate function.</returns>
|
||||
public static int CountF<T>(this List<T> source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
checked
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Count.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Count.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5337c0db0f170274587167b132a927c7
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
53
Assets/Scripts/NIH/LinqFaster/Distinct.cs
Normal file
53
Assets/Scripts/NIH/LinqFaster/Distinct.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Removes duplicate elements from source, does not maintain order. Elements will be
|
||||
/// sorted in ascending order.
|
||||
/// </summary>
|
||||
/// <param name="source">The list to remove duplicate elements from.</param>
|
||||
/// <param name="eqComparer">Optional IEqualityComparer to compare values.</param>
|
||||
/// <param name="comparer">Optional IComparer to compare values.</param>
|
||||
public static void DistinctInPlaceF<TSource>(this List<TSource> source, IEqualityComparer<TSource> eqComparer = null, IComparer<TSource> comparer = null)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (comparer == null)
|
||||
{
|
||||
comparer = Comparer<TSource>.Default;
|
||||
}
|
||||
|
||||
if (eqComparer == null)
|
||||
{
|
||||
eqComparer = EqualityComparer<TSource>.Default;
|
||||
}
|
||||
|
||||
source.Sort(comparer);
|
||||
|
||||
TSource oldV = source[0];
|
||||
int pos = 1;
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
var newV = source[i];
|
||||
source[pos] = newV;
|
||||
if (!eqComparer.Equals(newV, oldV))
|
||||
{
|
||||
pos++;
|
||||
}
|
||||
oldV = newV;
|
||||
}
|
||||
source.RemoveRange(pos, source.Count - pos);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Distinct.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Distinct.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d04d64ff5ae302449a864bfaae8dcfda
|
||||
timeCreated: 1518622478
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
202
Assets/Scripts/NIH/LinqFaster/First.cs
Normal file
202
Assets/Scripts/NIH/LinqFaster/First.cs
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
// -------------------------- Arrays --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first element of an array.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to return the first element of.</param>
|
||||
/// <returns>The first element in the specified array.</returns>
|
||||
public static T FirstF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
return source[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first element in an array that satisfies a specified condition.
|
||||
/// </summary>
|
||||
/// <param name="source">An array to return an element from.</param>
|
||||
/// <param name="predicate">A function to teast each element for a condition.</param>
|
||||
/// <returns>The first element that satisfies the condition.</returns>
|
||||
public static T FirstF<T>(this T[] source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
return source[i];
|
||||
}
|
||||
}
|
||||
|
||||
throw Error.NoMatch();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first element of an array, or a default value if the
|
||||
/// array contains no elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to return the first element of.</param>
|
||||
/// <returns>default value if source is empty, otherwise, the first element
|
||||
/// in source.</returns>
|
||||
public static T FirstOrDefaultF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
return source[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first element of the sequence that satisfies a condition or a
|
||||
/// default value if no such element is found.
|
||||
/// </summary>
|
||||
/// <param name="source">An IEnumerable to return an element from.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns></returns>
|
||||
public static T FirstOrDefaultF<T>(this T[] source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
return source[i];
|
||||
}
|
||||
}
|
||||
|
||||
return default(T);
|
||||
}
|
||||
|
||||
// -------------------------- Lists --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first element of a list
|
||||
/// </summary>
|
||||
/// <param name="source">The list to return the first element of.</param>
|
||||
/// <returns>The first element in the specified list.</returns>
|
||||
public static T FirstF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
return source[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first element in a list that satisfies a specified condition.
|
||||
/// </summary>
|
||||
/// <param name="source">An list to return an element from.</param>
|
||||
/// <param name="predicate">A function to teast each element for a condition.</param>
|
||||
/// <returns>The first element in the list that satisfies the condition.</returns>
|
||||
public static T FirstF<T>(this List<T> source, Predicate<T> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var firstIndex = source.FindIndex(predicate);
|
||||
if (firstIndex == -1)
|
||||
throw Error.NoMatch();
|
||||
else
|
||||
return source[firstIndex];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first element of an array, or a default value if the
|
||||
/// array contains no elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The array to return the first element of.</param>
|
||||
/// <returns>default value if source is empty, otherwise, the first element
|
||||
/// in source.</returns>
|
||||
public static T FirstOrDefaultF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
return source[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the first element of the sequence that satisfies a condition or a
|
||||
/// default value if no such element is found.
|
||||
/// </summary>
|
||||
/// <param name="source">An IEnumerable to return an element from.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns></returns>
|
||||
public static T FirstOrDefaultF<T>(this List<T> source, Predicate<T> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var firstIndex = source.FindIndex(predicate);
|
||||
if (firstIndex == -1)
|
||||
return default(T);
|
||||
else
|
||||
return source[firstIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/First.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/First.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7c8f855844813a24f8d07be8c7d7b7c5
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
194
Assets/Scripts/NIH/LinqFaster/Last.cs
Normal file
194
Assets/Scripts/NIH/LinqFaster/Last.cs
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- Arrays --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last element of a sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">An sequence to return the last element of.</param>
|
||||
/// <returns>The value at the last position in the source sequence.</returns>
|
||||
public static T LastF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
return source[source.Length - 1];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last element of a sequence that satisfies a specified condition.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return an element from.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns></returns>
|
||||
public static T LastF<T>(this T[] source, Predicate<T> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var lastIndex = Array.FindLastIndex(source, predicate);
|
||||
|
||||
if (lastIndex == -1)
|
||||
throw Error.NoMatch();
|
||||
else
|
||||
return source[lastIndex];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last element of a sequence, or a default value if the sequence contains no elements.
|
||||
/// </summary>
|
||||
/// <param name="source">An sequence to return the last element of.</param>
|
||||
/// <returns>default value if the source sequence is empty; otherwise,
|
||||
/// the last element in the sequence</returns>
|
||||
public static T LastOrDefaultF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
return source[source.Length - 1];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return the last element of.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>default value if the sequence is empty or if no elements pass the test
|
||||
/// in the predicate function; otherwise, the last element that passes the test in the
|
||||
/// predicate function.</returns>
|
||||
public static T LastOrDefaultF<T>(this T[] source, Predicate<T> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var lastIndex = Array.FindLastIndex(source, predicate);
|
||||
|
||||
if (lastIndex == -1)
|
||||
return default(T);
|
||||
else
|
||||
return source[lastIndex];
|
||||
}
|
||||
|
||||
// -------------------------- Lists --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last element of a sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">An sequence to return the last element of.</param>
|
||||
/// <returns>The value at the last position in the source sequence.</returns>
|
||||
public static T LastF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
return source[source.Count - 1];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last element of a sequence that satisfies a specified condition.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return an element from.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns></returns>
|
||||
public static T LastF<T>(this List<T> source, Predicate<T> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var lastIndex = source.FindLastIndex(predicate);
|
||||
|
||||
if (lastIndex == -1)
|
||||
throw Error.NoMatch();
|
||||
else
|
||||
return source[lastIndex];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last element of a sequence, or a default value if the sequence contains no elements.
|
||||
/// </summary>
|
||||
/// <param name="source">An sequence to return the last element of.</param>
|
||||
/// <returns>default value if the source sequence is empty; otherwise,
|
||||
/// the last element in the sequence</returns>
|
||||
public static T LastOrDefaultF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
return source[source.Count - 1];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the last element of a sequence that satisfies a condition or a default value if no such element is found.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return the last element of.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>default value if the sequence is empty or if no elements pass the test
|
||||
/// in the predicate function; otherwise, the last element that passes the test in the
|
||||
/// predicate function.</returns>
|
||||
public static T LastOrDefaultF<T>(this List<T> source, Predicate<T> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var lastIndex = source.FindLastIndex(predicate);
|
||||
|
||||
if (lastIndex == -1)
|
||||
return default(T);
|
||||
else
|
||||
return source[lastIndex];
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Last.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Last.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: aaf88d2684a9a9145ae297d38036fc14
|
||||
timeCreated: 1518622477
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
779
Assets/Scripts/NIH/LinqFaster/Max.cs
Normal file
779
Assets/Scripts/NIH/LinqFaster/Max.cs
Normal file
|
|
@ -0,0 +1,779 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
//int, long, float,double, decimal
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static T MaxF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
Comparer<T> comparer = Comparer<T>.Default;
|
||||
T r = default(T);
|
||||
if (r == null)
|
||||
{
|
||||
r = source[0];
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] != null && comparer.Compare(source[i], r) > 0) r = source[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = source[0];
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
if (comparer.Compare(source[i], r) > 0) r = source[i];
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static TResult MaxF<T, TResult>(this T[] source, Func<T, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
Comparer<TResult> comparer = Comparer<TResult>.Default;
|
||||
TResult r = default(TResult);
|
||||
if (r == null)
|
||||
{
|
||||
r = selector(source[0]);
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v != null && comparer.Compare(v, r) > 0) r = v;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = selector(source[0]);
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (comparer.Compare(v, r) > 0) r = v;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static int MaxF(this int[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
int r = int.MinValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static int MaxF<T>(this T[] source, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
int r = int.MinValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static long MaxF(this long[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
long r = long.MinValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static long MaxF<T>(this T[] source, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long r = long.MinValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static float MaxF(this float[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
float r = source[0];
|
||||
int startIndex = 0;
|
||||
for (; startIndex < source.Length; startIndex++)
|
||||
{
|
||||
if (!float.IsNaN(source[startIndex]))
|
||||
{
|
||||
r = source[startIndex];
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = startIndex; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static float MaxF<T>(this T[] source, Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
float r = selector(source[0]);
|
||||
int startIndex = 0;
|
||||
for (; startIndex < source.Length; startIndex++)
|
||||
{
|
||||
var v = selector(source[startIndex]);
|
||||
if (!float.IsNaN(v))
|
||||
{
|
||||
r = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = startIndex; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static double MaxF(this double[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
double r = source[0];
|
||||
int startIndex = 0;
|
||||
for (; startIndex < source.Length; startIndex++)
|
||||
{
|
||||
if (!double.IsNaN(source[startIndex]))
|
||||
{
|
||||
r = source[startIndex];
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = startIndex; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static double MaxF<T>(this T[] source, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double r = selector(source[0]);
|
||||
int startIndex = 0;
|
||||
for (; startIndex < source.Length; startIndex++)
|
||||
{
|
||||
var v = selector(source[startIndex]);
|
||||
if (!double.IsNaN(v))
|
||||
{
|
||||
r = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = startIndex; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static decimal MaxF(this decimal[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
decimal r = decimal.MinValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static decimal MaxF<T>(this T[] source, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
decimal r = decimal.MinValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static T MaxF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
Comparer<T> comparer = Comparer<T>.Default;
|
||||
T r = default(T);
|
||||
if (r == null)
|
||||
{
|
||||
r = source[0];
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] != null && comparer.Compare(source[i], r) > 0) r = source[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = source[0];
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
if (comparer.Compare(source[i], r) > 0) r = source[i];
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static TResult MaxF<T, TResult>(this List<T> source, Func<T, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
Comparer<TResult> comparer = Comparer<TResult>.Default;
|
||||
TResult r = default(TResult);
|
||||
if (r == null)
|
||||
{
|
||||
r = selector(source[0]);
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v != null && comparer.Compare(v, r) > 0) r = v;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = selector(source[0]);
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (comparer.Compare(v, r) > 0) r = v;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static int MaxF(this List<int> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
int r = int.MinValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static int MaxF<T>(this List<T> source, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
int r = int.MinValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static long MaxF(this List<long> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
long r = long.MinValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static long MaxF<T>(this List<T> source, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
long r = long.MinValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static float MaxF(this List<float> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
float r = source[0];
|
||||
int startIndex = 0;
|
||||
for (; startIndex < source.Count; startIndex++)
|
||||
{
|
||||
if (!float.IsNaN(source[startIndex]))
|
||||
{
|
||||
r = source[startIndex];
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = startIndex; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static float MaxF<T>(this List<T> source, Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
float r = selector(source[0]);
|
||||
int startIndex = 0;
|
||||
for (; startIndex < source.Count; startIndex++)
|
||||
{
|
||||
var v = selector(source[startIndex]);
|
||||
if (!float.IsNaN(v))
|
||||
{
|
||||
r = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = startIndex; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static double MaxF(this List<double> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
double r = source[0];
|
||||
int startIndex = 0;
|
||||
for (; startIndex < source.Count; startIndex++)
|
||||
{
|
||||
if (!double.IsNaN(source[startIndex]))
|
||||
{
|
||||
r = source[startIndex];
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = startIndex; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static double MaxF<T>(this List<T> source, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
double r = selector(source[0]);
|
||||
int startIndex = 0;
|
||||
for (; startIndex < source.Count; startIndex++)
|
||||
{
|
||||
var v = selector(source[startIndex]);
|
||||
if (!double.IsNaN(v))
|
||||
{
|
||||
r = v;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = startIndex; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the maximum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum of.</param>
|
||||
/// <returns>The maximum value in the sequence</returns>
|
||||
public static decimal MaxF(this List<decimal> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
decimal r = decimal.MinValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] > r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static decimal MaxF<T>(this List<T> source, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
decimal r = decimal.MinValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v > r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Max.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Max.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c48e3dffd69eb0a4e8e135b38d3d9bf0
|
||||
timeCreated: 1518622477
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
711
Assets/Scripts/NIH/LinqFaster/Min.cs
Normal file
711
Assets/Scripts/NIH/LinqFaster/Min.cs
Normal file
|
|
@ -0,0 +1,711 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
//int, long, float,double, decimal
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static T MinF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
Comparer<T> comparer = Comparer<T>.Default;
|
||||
T r = default(T);
|
||||
if (r == null)
|
||||
{
|
||||
r = source[0];
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] != null && comparer.Compare(source[i], r) < 0) r = source[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = source[0];
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
if (comparer.Compare(source[i], r) < 0) r = source[i];
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static TResult MinF<T, TResult>(this T[] source, Func<T, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
Comparer<TResult> comparer = Comparer<TResult>.Default;
|
||||
TResult r = default(TResult);
|
||||
if (r == null)
|
||||
{
|
||||
r = selector(source[0]);
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v != null && comparer.Compare(v, r) < 0) r = v;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = selector(source[0]);
|
||||
for (int i = 1; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (comparer.Compare(v, r) < 0) r = v;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static int MinF(this int[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
int r = int.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static int MinF<T>(this T[] source, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
int r = int.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static long MinF(this long[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
long r = long.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static long MinF<T>(this T[] source, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long r = long.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static float MinF(this float[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
float r = float.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
else if (float.IsNaN(source[i])) return source[i];
|
||||
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static float MinF<T>(this T[] source, Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
float r = float.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
else if (float.IsNaN(v)) return v;
|
||||
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static double MinF(this double[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
double r = double.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
else if (double.IsNaN(source[i])) return source[i];
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static double MinF<T>(this T[] source, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
double r = double.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
else if (double.IsNaN(v)) return v;
|
||||
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static decimal MinF(this decimal[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
decimal r = decimal.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static decimal MinF<T>(this T[] source, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
decimal r = decimal.MaxValue;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static T MinF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
Comparer<T> comparer = Comparer<T>.Default;
|
||||
T r = default(T);
|
||||
if (r == null)
|
||||
{
|
||||
r = source[0];
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] != null && comparer.Compare(source[i], r) < 0) r = source[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = source[0];
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
if (comparer.Compare(source[i], r) < 0) r = source[i];
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static int MinF(this List<int>source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
int r = int.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static int MinF<T>(this List<T> source, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
int r = int.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static long MinF(this List<long> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
long r = long.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static long MinF<T>(this List<T> source, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
long r = long.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static float MinF(this List<float> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
float r = float.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
else if (float.IsNaN(source[i])) return source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static float MinF<T>(this List<T> source, Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
float r = float.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
else if (float.IsNaN(v)) return v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static double MinF(this List<double> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
double r = double.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
else if (double.IsNaN(source[i])) return source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static double MinF<T>(this List<T> source, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double r = double.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
else if (double.IsNaN(v)) return v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the minimum value in a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the minimum of.</param>
|
||||
/// <returns>The minimum value in the sequence</returns>
|
||||
public static decimal MinF(this List<decimal> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
decimal r = decimal.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (source[i] < r) r = source[i];
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static decimal MinF<T>(this List<T> source, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
decimal r = decimal.MaxValue;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v < r) r = v;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes a transform function on each element of a sequence and returns the maximum value.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to determine the maximum value of.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>The maximum value in the transform of the sequence.</returns>
|
||||
public static TResult MinF<T, TResult>(this List<T> source, Func<T, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
Comparer<TResult> comparer = Comparer<TResult>.Default;
|
||||
TResult r = default(TResult);
|
||||
if (r == null)
|
||||
{
|
||||
r = selector(source[0]);
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (v != null && comparer.Compare(v, r) < 0) r = v;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
r = selector(source[0]);
|
||||
for (int i = 1; i < source.Count; i++)
|
||||
{
|
||||
var v = selector(source[i]);
|
||||
if (comparer.Compare(v, r) < 0) r = v;
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Min.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Min.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e778ffbe0914c7c4e88564ff2ba27fff
|
||||
timeCreated: 1518622478
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
144
Assets/Scripts/NIH/LinqFaster/OrderBy.cs
Normal file
144
Assets/Scripts/NIH/LinqFaster/OrderBy.cs
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using JM.LinqFaster.Utils;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
/// <summary>
|
||||
/// Sorts the elements of a sequence in ascending order according to a key.
|
||||
/// Unlike standard Linq NOT a stable sort.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to order.</param>
|
||||
/// <param name="keySelector">A function to extract a key from an element.</param>
|
||||
/// <param name="comparer">A Comparer to compare keys.</param>
|
||||
/// <returns>A sequence whose alements are ordered according to a key</returns>
|
||||
public static TSource[] OrderByF<TSource, TKey>(this TSource[] source, Func<TSource, TKey> keySelector,IComparer<TKey> comparer = null)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (keySelector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("keySelector");
|
||||
}
|
||||
|
||||
if (comparer == null)
|
||||
{
|
||||
comparer = Comparer<TKey>.Default;
|
||||
}
|
||||
|
||||
var keys = new TKey[source.Length];
|
||||
for (int i = 0; i < keys.Length; i++)
|
||||
{
|
||||
keys[i] = keySelector(source[i]);
|
||||
}
|
||||
var result = (TSource[])source.Clone();
|
||||
Array.Sort(keys,result,comparer);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sorts the elements of a sequence in descending order according to a key.
|
||||
/// Unlike standard Linq NOT a stable sort.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to order.</param>
|
||||
/// <param name="keySelector">A function to extract a key from an element.</param>
|
||||
/// <param name="comparer">A Comparer to compare keys.</param>
|
||||
/// <returns>A sequence whose alements are ordered according to a key</returns>
|
||||
public static TSource[] OrderByDescendingF<TSource, TKey>(this TSource[] source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer = null) {
|
||||
if (source == null) {
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (keySelector == null) {
|
||||
throw Error.ArgumentNull("keySelector");
|
||||
}
|
||||
|
||||
if (comparer == null) {
|
||||
comparer = Comparer<TKey>.Default;
|
||||
}
|
||||
|
||||
var keys = new TKey[source.Length];
|
||||
for (int i = 0; i < keys.Length; i++) {
|
||||
keys[i] = keySelector(source[i]);
|
||||
}
|
||||
var result = (TSource[])source.Clone();
|
||||
Array.Sort(keys, result, comparer.Reverse());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------- Lists
|
||||
|
||||
/// <summary>
|
||||
/// Sorts the elements of a sequence in ascending order according to a key.
|
||||
/// Unlike standard Linq NOT a stable sort.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to order.</param>
|
||||
/// <param name="keySelector">A function to extract a key from an element.</param>
|
||||
/// <param name="comparer">A Comparer to compare keys.</param>
|
||||
/// <returns>A sequence whose alements are ordered according to a key</returns>
|
||||
public static List<TSource> OrderByF<TSource, TKey>(this List<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer = null)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (keySelector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("keySelector");
|
||||
}
|
||||
|
||||
if (comparer == null)
|
||||
{
|
||||
comparer = Comparer<TKey>.Default;
|
||||
}
|
||||
|
||||
var result = new List<TSource>(source);
|
||||
var lambdaComparer = new LambdaComparer<TSource, TKey>(keySelector, comparer);
|
||||
result.Sort(lambdaComparer);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sorts the elements of a sequence in descending order according to a key.
|
||||
/// Unlike standard Linq NOT a stable sort.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to order.</param>
|
||||
/// <param name="keySelector">A function to extract a key from an element.</param>
|
||||
/// <param name="comparer">A Comparer to compare keys.</param>
|
||||
/// <returns>A sequence whose alements are ordered according to a key</returns>
|
||||
public static List<TSource> OrderByDescendingF<TSource, TKey>(this List<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer = null) {
|
||||
if (source == null) {
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (keySelector == null) {
|
||||
throw Error.ArgumentNull("keySelector");
|
||||
}
|
||||
|
||||
if (comparer == null) {
|
||||
comparer = Comparer<TKey>.Default;
|
||||
}
|
||||
|
||||
var result = new List<TSource>(source);
|
||||
var lambdaComparer = new ReverseLambdaComparer<TSource, TKey>(keySelector, comparer);
|
||||
result.Sort(lambdaComparer);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
13
Assets/Scripts/NIH/LinqFaster/OrderBy.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/OrderBy.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0905671e8837b8746ab9d2540689f16c
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
56
Assets/Scripts/NIH/LinqFaster/Range.cs
Normal file
56
Assets/Scripts/NIH/LinqFaster/Range.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
/// <summary>
|
||||
/// Generates a sequence of integral numbers within a specified range.
|
||||
/// </summary>
|
||||
/// <param name="start">The value of the first integer in the sequence.</param>
|
||||
/// <param name="count">The number of sequential integers to generate.</param>
|
||||
/// <returns>A sequence that contains a range of sequential integral numbers.</returns>
|
||||
public static int[] RangeArrayF(int start, int count)
|
||||
{
|
||||
long max = ((long)start) + count - 1;
|
||||
if (count < 0 || max > int.MaxValue)
|
||||
{
|
||||
throw Error.ArgumentOutOfRange("count");
|
||||
}
|
||||
|
||||
|
||||
int[] result = new int[count];
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
{
|
||||
result[i] = i + start;
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Generates a sequence of integral numbers within a specified range.
|
||||
/// </summary>
|
||||
/// <param name="start">The value of the first integer in the sequence.</param>
|
||||
/// <param name="count">The number of sequential integers to generate.</param>
|
||||
/// <returns>A sequence that contains a range of sequential integral numbers.</returns>
|
||||
public static List<int> RangeListF(int start, int count)
|
||||
{
|
||||
long max = ((long)start) + count - 1;
|
||||
if (count < 0 || max > int.MaxValue)
|
||||
{
|
||||
throw Error.ArgumentOutOfRange("count");
|
||||
}
|
||||
|
||||
|
||||
var result = new List<int>(count);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
result.Add(i + start);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Range.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Range.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2b57c73286e4b784a897b514585dcdc2
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/Scripts/NIH/LinqFaster/Repeat.cs
Normal file
46
Assets/Scripts/NIH/LinqFaster/Repeat.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// ------------------------ Arrays ---------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Generates a sequence that contains one repeated value.
|
||||
/// </summary>
|
||||
/// <param name="element">The value to be repeated.</param>
|
||||
/// <param name="count">The number of times to repeat the value in the generated sequence.</param>
|
||||
/// <returns>A sequence that contains a repeated value</returns>
|
||||
public static T[] RepeatArrayF<T>(T element, int count)
|
||||
{
|
||||
var result = new T[count];
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
{
|
||||
result[i] = element;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// ------------------------ Lists ---------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Generates a sequence that contains one repeated value.
|
||||
/// </summary>
|
||||
/// <param name="element">The value to be repeated.</param>
|
||||
/// <param name="count">The number of times to repeat the value in the generated sequence.</param>
|
||||
/// <returns>A sequence that contains a repeated value</returns>
|
||||
public static List<T> RepeatListF<T>(T element, int count)
|
||||
{
|
||||
var result = new List<T>(count);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
result.Add(element);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Repeat.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Repeat.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a9a067c2d04a41e499adfde8c8ab6956
|
||||
timeCreated: 1518622477
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
58
Assets/Scripts/NIH/LinqFaster/Reverse.cs
Normal file
58
Assets/Scripts/NIH/LinqFaster/Reverse.cs
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
/// <summary>
|
||||
/// Inverts the order of the elements in a sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to reverse.</param>
|
||||
/// <returns>A sequence whose elements correspond to those of the input sequence in reverse order.</returns>
|
||||
public static T[] ReverseF<T>(this T[] source)
|
||||
{
|
||||
var result = new T[source.Length];
|
||||
long lenLessOne = source.Length - 1;
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
{
|
||||
result[i] = source[lenLessOne - i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Inverts the order of the elements in a sequence in place.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to reverse.</param>
|
||||
public static void ReverseInPlaceF<T>(this T[] source)
|
||||
{
|
||||
Array.Reverse(source);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inverts the order of the elements in a sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to reverse.</param>
|
||||
/// <returns>A sequence whose elements correspond to those of the input sequence in reverse order.</returns>
|
||||
public static List<T> ReverseF<T>(this List<T> source)
|
||||
{
|
||||
var result = new List<T>(source.Count);
|
||||
for (int i = source.Count - 1; i >= 0; i--)
|
||||
{
|
||||
result.Add(source[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inverts the order of the elements in a sequence in place.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to reverse.</param>
|
||||
public static void ReverseInPlaceF<T>(this List<T> source)
|
||||
{
|
||||
source.Reverse();
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Reverse.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Reverse.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 060a1817dc4b6a14997095dfc23c4d3b
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
219
Assets/Scripts/NIH/LinqFaster/Select.cs
Normal file
219
Assets/Scripts/NIH/LinqFaster/Select.cs
Normal file
|
|
@ -0,0 +1,219 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence into a new form in place.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to invoke a transform function on (map).</param>
|
||||
/// <param name="selector">A transform function to apply (map) to each element.</param>
|
||||
public static void SelectInPlaceF<T>(this T[] source, Func<T,T> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
source[i] = selector(source[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence into a new form, in place, by incorporating the element's index.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to invoke a transform function on.</param>
|
||||
/// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
|
||||
public static void SelectInPlaceF<T>(this T[] source, Func<T, int, T> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
source[i] = selector(source[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence into a new form. (map in every other language)
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to invoke a transform function on (map).</param>
|
||||
/// <param name="selector">A transform function to apply (map) to each element.</param>
|
||||
/// <returns>A sequence whose elements are the result of invoking the transform function on each element (mapping) of source.</returns>
|
||||
public static TResult[] SelectF<T, TResult>(this T[] source, Func<T, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
var r = new TResult[source.Length];
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
r[i] = selector(source[i]);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence into a new form by incorporating the element's index.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to invoke a transform function on.</param>
|
||||
/// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
|
||||
/// <returns>A sequence whose elements are the result of invoking the transform function on each element of source.</returns>
|
||||
public static TResult[] SelectF<T, TResult>(this T[] source, Func<T, int, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
var r = new TResult[source.Length];
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
r[i] = selector(source[i], i);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence into a new form in place.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to invoke a transform function on (map).</param>
|
||||
/// <param name="selector">A transform function to apply (map) to each element.</param>
|
||||
public static void SelectInPlaceF<T>(this List<T> source, Func<T, T> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
source[i] = selector(source[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence into a new form, in place, by incorporating the element's index.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to invoke a transform function on.</param>
|
||||
/// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
|
||||
public static void SelectInPlaceF<T>(this List<T> source, Func<T, int, T> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
source[i] = selector(source[i], i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence into a new form. (map in every other language)
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to invoke a transform function on (map).</param>
|
||||
/// <param name="selector">A transform function to apply (map) to each element.</param>
|
||||
/// <returns>A sequence whose elements are the result of invoking the transform function on each element (mapping) of source.</returns>
|
||||
public static List<TResult> SelectF<T, TResult>(this List<T> source, Func<T, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
var r = new List<TResult>(source.Count);
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
r.Add(selector(source[i]));
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence into a new form by incorporating the element's index.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to invoke a transform function on.</param>
|
||||
/// <param name="selector">A transform function to apply to each source element; the second parameter of the function represents the index of the source element.</param>
|
||||
/// <returns>A sequence whose elements are the result of invoking the transform function on each element of source.</returns>
|
||||
public static List<TResult> SelectF<T, TResult>(this List<T> source, Func<T, int, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
var r = new List<TResult>(source.Count);
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
r.Add(selector(source[i],i));
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Select.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Select.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 26eaf75f376ca7147a6c161177592aca
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
136
Assets/Scripts/NIH/LinqFaster/SelectMany.cs
Normal file
136
Assets/Scripts/NIH/LinqFaster/SelectMany.cs
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- Arrays --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence to another sequence and flattens the resulting sequences into one sequence.
|
||||
/// Yo dawg, I heard you like sequences.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to project.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>A sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
|
||||
public static TResult[] SelectManyF<TSource, TResult>(this TSource[] source, Func<TSource, TResult[]> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
var result = new List<TResult>(source.Length);
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var va = selector(source[i]);
|
||||
for (int j = 0; j < va.Length; j++)
|
||||
{
|
||||
result.Add(va[j]);
|
||||
}
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence to another sequence and flattens the resulting sequences into one sequence
|
||||
/// utilizing the index of each element.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to project.</param>
|
||||
/// <param name="selector">A transform function to apply to each element and it's index.</param>
|
||||
/// <returns>A sequence whose elements are the result of invoking the one-to-many transform function on each element and index of the input sequence.</returns>
|
||||
public static TResult[] SelectManyF<TSource, TResult>(this TSource[] source, Func<TSource, int, TResult[]> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
var result = new List<TResult>(source.Length);
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var va = selector(source[i], i);
|
||||
for (int j = 0; j < va.Length; j++)
|
||||
{
|
||||
result.Add(va[j]);
|
||||
}
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence to another sequence and flattens the resulting sequences into one sequence.
|
||||
/// Yo dawg, I heard you like sequences.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to project.</param>
|
||||
/// <param name="selector">A transform function to apply to each element.</param>
|
||||
/// <returns>A sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence.</returns>
|
||||
public static List<TResult> SelectManyF<TSource, TResult>(this List<TSource> source, Func<TSource, List<TResult>> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
var result = new List<TResult>(source.Count);
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var va = selector(source[i]);
|
||||
for (int j = 0; j < va.Count; j++)
|
||||
{
|
||||
result.Add(va[j]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Projects each element of a sequence to another sequence and flattens the resulting sequences into one sequence
|
||||
/// utilizing the index of each element.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence of values to project.</param>
|
||||
/// <param name="selector">A transform function to apply to each element and it's index.</param>
|
||||
/// <returns>A sequence whose elements are the result of invoking the one-to-many transform function on each element and index of the input sequence.</returns>
|
||||
public static List<TResult> SelectManyF<TSource, TResult>(this List<TSource> source, Func<TSource, int, List<TResult>> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
var result = new List<TResult>(source.Count);
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var va = selector(source[i], i);
|
||||
for (int j = 0; j < va.Count; j++)
|
||||
{
|
||||
result.Add(va[j]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/SelectMany.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/SelectMany.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 8c94982c6c13eb2479b832d2210b5451
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
142
Assets/Scripts/NIH/LinqFaster/SelectWhere.cs
Normal file
142
Assets/Scripts/NIH/LinqFaster/SelectWhere.cs
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Combines Select and Where into a single call for optimal
|
||||
/// performance.
|
||||
/// </summary>
|
||||
/// <param name="source">The input sequence to filter and select</param>
|
||||
/// <param name="selector">The transformation to apply before filtering.</param>
|
||||
/// <param name="predicate">The predicate with which to filter result.</param>
|
||||
/// <returns>A seqence transformed and then filtered by selector and predicate.</returns>
|
||||
public static TResult[] SelectWhereF<T, TResult>(this T[] source, Func<T, TResult> selector, Func<TResult, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = new TResult[source.Length];
|
||||
int idx = 0;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var s = selector(source[i]);
|
||||
if (predicate(s))
|
||||
{
|
||||
result[idx] = s;
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
Array.Resize(ref result, idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines Select and Where with indexes into a single call for optimal
|
||||
/// performance.
|
||||
/// </summary>
|
||||
/// <param name="source">The input sequence to filter and select</param>
|
||||
/// <param name="selector">The transformation with index to apply before filtering.</param>
|
||||
/// <param name="predicate">The predicate with index with which to filter result.</param>
|
||||
/// <returns>A seqence transformed and then filtered by selector and predicate with indexes.</returns>
|
||||
public static TResult[] SelectWhereF<T, TResult>(this T[] source, Func<T, int, TResult> selector, Func<TResult, int, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = new TResult[source.Length];
|
||||
int idx = 0;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
var s = selector(source[i], i);
|
||||
if (predicate(s, i))
|
||||
{
|
||||
result[idx] = s;
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
Array.Resize(ref result, idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Combines Select and Where into a single call for optimal
|
||||
/// performance.
|
||||
/// </summary>
|
||||
/// <param name="source">The input sequence to filter and select</param>
|
||||
/// <param name="selector">The transformation to apply before filtering.</param>
|
||||
/// <param name="predicate">The predicate with which to filter result.</param>
|
||||
/// <returns>A seqence transformed and then filtered by selector and predicate.</returns>
|
||||
public static List<TResult> SelectWhereF<T, TResult>(this List<T> source, Func<T, TResult> selector, Func<TResult, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var r = new List<TResult>();
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = selector(source[i]);
|
||||
if (predicate(s)) r.Add(s);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines Select and Where with indexes into a single call for optimal
|
||||
/// performance.
|
||||
/// </summary>
|
||||
/// <param name="source">The input sequence to filter and select</param>
|
||||
/// <param name="selector">The transformation with index to apply before filtering.</param>
|
||||
/// <param name="predicate">The predicate with index with which to filter result.</param>
|
||||
/// <returns>A seqence transformed and then filtered by selector and predicate with indexes.</returns>
|
||||
public static List<TResult> SelectWhereF<T, TResult>(this List<T> source, Func<T, int, TResult> selector, Func<TResult, int, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var r = new List<TResult>();
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = selector(source[i], i);
|
||||
if (predicate(s, i)) r.Add(s);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/SelectWhere.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/SelectWhere.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d0a9e823f84f85049ae653bf4fc8c7b9
|
||||
timeCreated: 1518622478
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
153
Assets/Scripts/NIH/LinqFaster/SequenceEqual.cs
Normal file
153
Assets/Scripts/NIH/LinqFaster/SequenceEqual.cs
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether two sequences are equal by comparing the elements by using the
|
||||
/// provided comparer or the default equality comparer for their type if none is provided.
|
||||
/// </summary>
|
||||
/// <param name="first">A sequence to compare to second.</param>
|
||||
/// <param name="second">A sequence to compare to first.</param>
|
||||
/// <param name="comparer">An optional Comparer to use for the comparison.</param>
|
||||
/// <returns>true of the two sources are of equal length and their corresponding
|
||||
/// elements are equal according to the equality comparer. Otherwise, false.</returns>
|
||||
public static bool SequenceEqualF<T>(T[] first, T[] second, IEqualityComparer<T> comparer = null)
|
||||
{
|
||||
if (comparer == null)
|
||||
{
|
||||
comparer = EqualityComparer<T>.Default;
|
||||
}
|
||||
|
||||
if (first == null)
|
||||
{
|
||||
throw Error.ArgumentNull("first");
|
||||
}
|
||||
|
||||
if (second == null)
|
||||
{
|
||||
throw Error.ArgumentNull("second");
|
||||
}
|
||||
|
||||
if (first.Length != second.Length) return false;
|
||||
|
||||
for (int i = 0; i < first.Length; i++)
|
||||
{
|
||||
if (!comparer.Equals(first[i], second[i])) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether two sequences are equal by comparing the elements by using the
|
||||
/// provided comparer or the default equality comparer for their type if none is provided.
|
||||
/// </summary>
|
||||
/// <param name="first">A sequence to compare to second.</param>
|
||||
/// <param name="second">A sequence to compare to first.</param>
|
||||
/// <param name="comparer">An optional Comparer to use for the comparison.</param>
|
||||
/// <returns>true of the two sources are of equal length and their corresponding
|
||||
/// elements are equal according to the equality comparer. Otherwise, false.</returns>
|
||||
public static bool SequenceEqualF<T>(List<T> first, List<T> second, IEqualityComparer<T> comparer = null)
|
||||
{
|
||||
if (comparer == null)
|
||||
{
|
||||
comparer = EqualityComparer<T>.Default;
|
||||
}
|
||||
|
||||
if (first == null)
|
||||
{
|
||||
throw Error.ArgumentNull("first");
|
||||
}
|
||||
|
||||
if (second == null)
|
||||
{
|
||||
throw Error.ArgumentNull("second");
|
||||
}
|
||||
|
||||
if (first.Count != second.Count) return false;
|
||||
|
||||
for (int i = 0; i < first.Count; i++)
|
||||
{
|
||||
if (!comparer.Equals(first[i], second[i])) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether two sequences are equal by comparing the elements by using the
|
||||
/// provided comparer or the default equality comparer for their type if none is provided.
|
||||
/// </summary>
|
||||
/// <param name="first">A sequence to compare to second.</param>
|
||||
/// <param name="second">A sequence to compare to first.</param>
|
||||
/// <param name="comparer">An optional Comparer to use for the comparison.</param>
|
||||
/// <returns>true of the two sources are of equal length and their corresponding
|
||||
/// elements are equal according to the equality comparer. Otherwise, false.</returns>
|
||||
public static bool SequenceEqualF<T>(T[] first, List<T> second, IEqualityComparer<T> comparer = null)
|
||||
{
|
||||
if (comparer == null)
|
||||
{
|
||||
comparer = EqualityComparer<T>.Default;
|
||||
}
|
||||
|
||||
if (first == null)
|
||||
{
|
||||
throw Error.ArgumentNull("first");
|
||||
}
|
||||
|
||||
if (second == null)
|
||||
{
|
||||
throw Error.ArgumentNull("second");
|
||||
}
|
||||
|
||||
if (first.Length != second.Count) return false;
|
||||
|
||||
for (int i = 0; i < first.Length; i++)
|
||||
{
|
||||
if (!comparer.Equals(first[i], second[i])) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether two sequences are equal by comparing the elements by using the
|
||||
/// provided comparer or the default equality comparer for their type if none is provided.
|
||||
/// </summary>
|
||||
/// <param name="first">A sequence to compare to second.</param>
|
||||
/// <param name="second">A sequence to compare to first.</param>
|
||||
/// <param name="comparer">An optional Comparer to use for the comparison.</param>
|
||||
/// <returns>true of the two sources are of equal length and their corresponding
|
||||
/// elements are equal according to the equality comparer. Otherwise, false.</returns>
|
||||
public static bool SequenceEqualF<T>(List<T> first, T[] second, IEqualityComparer<T> comparer = null)
|
||||
{
|
||||
if (comparer == null)
|
||||
{
|
||||
comparer = EqualityComparer<T>.Default;
|
||||
}
|
||||
|
||||
if (first == null)
|
||||
{
|
||||
throw Error.ArgumentNull("first");
|
||||
}
|
||||
|
||||
if (second == null)
|
||||
{
|
||||
throw Error.ArgumentNull("second");
|
||||
}
|
||||
|
||||
if (first.Count != second.Length) return false;
|
||||
|
||||
for (int i = 0; i < first.Count; i++)
|
||||
{
|
||||
if (!comparer.Equals(first[i], second[i])) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/SequenceEqual.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/SequenceEqual.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7fe4476c042c98d4dbae1292ea8da673
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
275
Assets/Scripts/NIH/LinqFaster/Single.cs
Normal file
275
Assets/Scripts/NIH/LinqFaster/Single.cs
Normal file
|
|
@ -0,0 +1,275 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// --------------------------- Arrays ----------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return the single element of</param>
|
||||
/// <returns>The single element of the input sequence or default if no elements exist.</returns>
|
||||
public static T SingleF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (source.Length > 1) {
|
||||
throw Error.MoreThanOneElement();
|
||||
}
|
||||
|
||||
return source[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the only element of a sequence, or the default if no elements exist, and throws an exception if there is not exactly one element in the sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return the single element of</param>
|
||||
/// <returns>The single element of the input sequence</returns>
|
||||
public static T SingleOrDefaultF<T>(this T[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Length == 0)
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
|
||||
if (source.Length > 1) {
|
||||
throw Error.MoreThanOneElement();
|
||||
}
|
||||
|
||||
return source[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return a single element from.</param>
|
||||
/// <param name="predicate">A function to test an element for a condition.</param>
|
||||
/// <returns>The single element of the input sequence that satisfies a condition.</returns>
|
||||
public static T SingleF<T>(this T[] source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
T result = default(T);
|
||||
bool foundMatch = false;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
if (foundMatch)
|
||||
{
|
||||
throw Error.MoreThanOneMatch();
|
||||
}
|
||||
|
||||
result = source[i];
|
||||
foundMatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundMatch)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Error.NoMatch();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the only element of a sequence that satisfies a specified condition, or a default value if
|
||||
/// no such element exists, and throws an exception if more than one such element exists.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return a single element from.</param>
|
||||
/// <param name="predicate">A function to test an element for a condition.</param>
|
||||
/// <returns>The single element of the input sequence that satisfies a condition or default value if no such element is found.</returns>
|
||||
public static T SingleOrDefaultF<T>(this T[] source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
|
||||
T result = default(T);
|
||||
bool foundMatch = false;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
if (foundMatch)
|
||||
{
|
||||
throw Error.MoreThanOneMatch();
|
||||
}
|
||||
|
||||
result = source[i];
|
||||
foundMatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// --------------------------- Lists ----------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return the single element of</param>
|
||||
/// <returns>The single element of the input sequence</returns>
|
||||
public static T SingleF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
throw Error.NoElements();
|
||||
}
|
||||
|
||||
if (source.Count > 1) {
|
||||
throw Error.MoreThanOneElement();
|
||||
}
|
||||
|
||||
return source[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the only element of a sequence, or default if no elements exist, and throws an exception if there is not exactly one element in the sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return the single element of</param>
|
||||
/// <returns>The single element of the input sequence or default if no elements exist.</returns>
|
||||
public static T SingleOrDefaultF<T>(this List<T> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (source.Count == 0)
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
|
||||
if (source.Count > 1) {
|
||||
throw Error.MoreThanOneElement();
|
||||
}
|
||||
|
||||
return source[0];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return a single element from.</param>
|
||||
/// <param name="predicate">A function to test an element for a condition.</param>
|
||||
/// <returns>The single element of the input sequence that satisfies a condition.</returns>
|
||||
public static T SingleF<T>(this List<T> source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
T result = default(T);
|
||||
bool foundMatch = false;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
if (foundMatch)
|
||||
{
|
||||
throw Error.MoreThanOneMatch();
|
||||
}
|
||||
|
||||
result = source[i];
|
||||
foundMatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (foundMatch)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw Error.NoMatch();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the only element of a sequence that satisfies a specified condition, or a default value if
|
||||
/// no such element exists, and throws an exception if more than one such element exists.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return a single element from.</param>
|
||||
/// <param name="predicate">A function to test an element for a condition.</param>
|
||||
/// <returns>The single element of the input sequence that satisfies a condition or default value if no such element is found.</returns>
|
||||
public static T SingleOrDefaultF<T>(this List<T> source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
T result = default(T);
|
||||
bool foundMatch = false;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
if (foundMatch)
|
||||
{
|
||||
throw Error.MoreThanOneMatch();
|
||||
}
|
||||
|
||||
result = source[i];
|
||||
foundMatch = true;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Single.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Single.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 50d60901bb3bf014e8d8e1ceef8c4741
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
129
Assets/Scripts/NIH/LinqFaster/Skip.cs
Normal file
129
Assets/Scripts/NIH/LinqFaster/Skip.cs
Normal file
|
|
@ -0,0 +1,129 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
/// <summary>
|
||||
/// Bypasses a specified number of elements in a sequence and then returns the remaining elements.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return elements from.</param>
|
||||
/// <param name="count">The number of elements to skip before returning the remaining elements.</param>
|
||||
/// <returns>A sequence that contains the elements that occur after the specified index in the input sequence.</returns>
|
||||
public static T[] SkipF<T>(this T[] source, int count)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
count = 0;
|
||||
}
|
||||
else if (count > source.Length)
|
||||
{
|
||||
return new T[0];
|
||||
}
|
||||
|
||||
var result = new T[source.Length - count];
|
||||
Array.Copy(source, count, result, 0, result.Length);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return elements from.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>A sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.</returns>
|
||||
public static T[] SkipWhileF<T>(this T[] source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (; i < source.Length; i++)
|
||||
{
|
||||
if (!predicate(source[i])) break;
|
||||
}
|
||||
var result = new T[source.Length - i];
|
||||
Array.Copy(source, i, result, 0, result.Length);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ------------- Lists ----------------
|
||||
|
||||
/// <summary>
|
||||
/// Bypasses a specified number of elements in a sequence and then returns the remaining elements.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return elements from.</param>
|
||||
/// <param name="count">The number of elements to skip before returning the remaining elements.</param>
|
||||
/// <returns>A sequence that contains the elements that occur after the specified index in the input sequence.</returns>
|
||||
public static List<T> SkipF<T>(this List<T> source, int count)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
count = 0;
|
||||
}
|
||||
else if (count > source.Count)
|
||||
{
|
||||
return new List<T>();
|
||||
}
|
||||
|
||||
var result = new List<T>(source.Count - count);
|
||||
for (int i = count; i < source.Count; i++)
|
||||
{
|
||||
result.Add(source[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return elements from.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>A sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate.</returns>
|
||||
public static List<T> SkipWhileF<T>(this List<T> source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (; i < source.Count; i++)
|
||||
{
|
||||
if (!predicate(source[i])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var result = new List<T>(source.Count - i);
|
||||
for (; i < source.Count; i++)
|
||||
{
|
||||
result.Add(source[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Skip.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Skip.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0266806ba237aed45b52c7709de1fe6b
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
504
Assets/Scripts/NIH/LinqFaster/Sum.cs
Normal file
504
Assets/Scripts/NIH/LinqFaster/Sum.cs
Normal file
|
|
@ -0,0 +1,504 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static int SumF(this int[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
int sum = 0;
|
||||
checked
|
||||
{
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static int SumF<T>(this T[] source, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
int sum = 0;
|
||||
checked
|
||||
{
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static long SumF(this long[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static long SumF<T>(this T[] source, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static float SumF(this float[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
double sum = 0;
|
||||
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
|
||||
return (float)sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static float SumF<T>(this T[] source, Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
|
||||
return (float)sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static double SumF(this double[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
double sum = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static double SumF<T>(this T[] source, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static decimal SumF(this decimal[] source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
decimal sum = 0;
|
||||
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static decimal SumF<T>(this T[] source, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
decimal sum = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static int SumF(this List<int> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
int sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static int SumF<T>(this List<T> source, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
int sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static long SumF(this List<long> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static long SumF<T>(this List<T> source, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static float SumF(this List<float> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return (float)sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static float SumF<T>(this List<T> source, Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return (float)sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static double SumF(this List<double> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
double sum = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static double SumF<T>(this List<T> source, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a sequence of values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static decimal SumF(this List<decimal> source)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
decimal sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += source[i];
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the transformed sequence of elements.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static decimal SumF<T>(this List<T> source, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
decimal sum = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
sum += selector(source[i]);
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Sum.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Sum.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c45ad2500ea1ddd46af3645fba2bfc4c
|
||||
timeCreated: 1518622477
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
188
Assets/Scripts/NIH/LinqFaster/Take.cs
Normal file
188
Assets/Scripts/NIH/LinqFaster/Take.cs
Normal file
|
|
@ -0,0 +1,188 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Returns a specified number of contiguous elements from the start of a sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to return elements from.</param>
|
||||
/// <param name="count">The number of elements to return.</param>
|
||||
/// <returns>A sequence that contains the specified number of elements from the start of the input sequence.</returns>
|
||||
public static T[] TakeF<T>(this T[] source, int count)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
count = 0;
|
||||
}
|
||||
else if (count > source.Length)
|
||||
{
|
||||
count = source.Length;
|
||||
}
|
||||
|
||||
var result = new T[count];
|
||||
Array.Copy(source, 0, result, 0, count);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns elements from a sequence as long as a specified condition is true.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return elements from.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>A sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.</returns>
|
||||
public static T[] TakeWhileF<T>(this T[] source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = new List<T>();
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
result.Add(source[i]);
|
||||
else
|
||||
return result.ToArray();
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to return elements from.</param>
|
||||
/// <param name="predicate">A function to test each source element for a condition; the second parameter of the function represents the index of the source element.</param>
|
||||
/// <returns>A sequence that contains elements from the input sequence that occur before the element at which the test no longer passes.</returns>
|
||||
public static T[] TakeWhileF<T>(this T[] source, Func<T,int, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = new List<T>();
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i],i))
|
||||
result.Add(source[i]);
|
||||
else
|
||||
return result.ToArray();
|
||||
}
|
||||
return result.ToArray();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ------------- Lists ----------------
|
||||
|
||||
/// <summary>
|
||||
/// Returns a specified number of contiguous elements from the start of a sequence.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to return elements from.</param>
|
||||
/// <param name="count">The number of elements to return.</param>
|
||||
/// <returns>A sequence that contains the specified number of elements from the start of the input sequence.</returns>
|
||||
public static List<T> TakeF<T>(this List<T> source, int count)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (count < 0)
|
||||
{
|
||||
count = 0;
|
||||
}
|
||||
else if (count > source.Count)
|
||||
{
|
||||
count = source.Count;
|
||||
}
|
||||
|
||||
var result = new List<T>(count);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
result.Add(source[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns elements from a sequence as long as a specified condition is true.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to return elements from.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>A sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes.</returns>
|
||||
public static List<T> TakeWhileF<T>(this List<T> source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = new List<T>();
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
result.Add(source[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to return elements from.</param>
|
||||
/// <param name="predicate">A function to test each source element for a condition; the second parameter of the function represents the index of the source element.</param>
|
||||
/// <returns>A sequence that contains elements from the input sequence that occur before the element at which the test no longer passes.</returns>
|
||||
public static List<T> TakeWhileF<T>(this List<T> source, Func<T, int, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = new List<T>();
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i], i))
|
||||
result.Add(source[i]);
|
||||
else
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Take.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Take.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f9aaaef92e9c332418190038d49b4389
|
||||
timeCreated: 1518622478
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
10
Assets/Scripts/NIH/LinqFaster/Utils.meta
Normal file
10
Assets/Scripts/NIH/LinqFaster/Utils.meta
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d27acc7ea045f65488b96d108768512f
|
||||
folderAsset: yes
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
62
Assets/Scripts/NIH/LinqFaster/Utils/ComparerMagic.cs
Normal file
62
Assets/Scripts/NIH/LinqFaster/Utils/ComparerMagic.cs
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace JM.LinqFaster.Utils {
|
||||
|
||||
//Takes a comparer, and creates a reverse comparer, for Descending sorts
|
||||
internal sealed class ComparerReverser<T> : IComparer<T> {
|
||||
private readonly IComparer<T> wrappedComparer;
|
||||
|
||||
public ComparerReverser(IComparer<T> wrappedComparer) {
|
||||
this.wrappedComparer = wrappedComparer;
|
||||
}
|
||||
#if !(UNITY_4 || UNITY_5)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
#endif
|
||||
public int Compare(T x, T y) {
|
||||
return wrappedComparer.Compare(y, x);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal static class ComparerExtensions {
|
||||
|
||||
// Lets us reverse a comparere with comparer.Reverse();
|
||||
public static IComparer<T> Reverse<T>(this IComparer<T> comparer) {
|
||||
return new ComparerReverser<T>(comparer);
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class LambdaComparer<T, U> : IComparer<T> {
|
||||
IComparer<U> comparer;
|
||||
Func<T, U> selector;
|
||||
|
||||
public LambdaComparer(Func<T, U> selector, IComparer<U> comparer) {
|
||||
this.comparer = comparer;
|
||||
this.selector = selector;
|
||||
}
|
||||
#if !(UNITY_4 || UNITY_5)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
#endif
|
||||
public int Compare(T x, T y) {
|
||||
return comparer.Compare(selector(x), selector(y));
|
||||
}
|
||||
}
|
||||
|
||||
internal sealed class ReverseLambdaComparer<T, U> : IComparer<T> {
|
||||
IComparer<U> comparer;
|
||||
Func<T, U> selector;
|
||||
|
||||
public ReverseLambdaComparer(Func<T, U> selector, IComparer<U> comparer) {
|
||||
this.comparer = comparer;
|
||||
this.selector = selector;
|
||||
}
|
||||
#if !(UNITY_4 || UNITY_5)
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
#endif
|
||||
public int Compare(T x, T y) {
|
||||
return comparer.Compare(selector(y), selector(x));
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Utils/ComparerMagic.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Utils/ComparerMagic.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 58968b2b3f2b61943a1723873cdb7288
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
38
Assets/Scripts/NIH/LinqFaster/Utils/CustomPartition.cs
Normal file
38
Assets/Scripts/NIH/LinqFaster/Utils/CustomPartition.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#if !(UNITY_4 || UNITY_5)
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
|
||||
namespace JM.LinqFaster.Utils
|
||||
{
|
||||
internal static class CustomPartition
|
||||
{
|
||||
public static OrderablePartitioner<Tuple<int,int>> MakePartition(int len, int? batchSize)
|
||||
{
|
||||
if (batchSize == null)
|
||||
{
|
||||
return Partitioner.Create(0, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Partitioner.Create(0, len, batchSize.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public static OrderablePartitioner<Tuple<int, int>> MakeSIMDPartition(int len, int chunkSize, int? batchSize)
|
||||
{
|
||||
int chunkLen = len - len % chunkSize;
|
||||
int numChunks = chunkLen / chunkSize;
|
||||
if (batchSize == null)
|
||||
{
|
||||
return Partitioner.Create(0, numChunks,numChunks/Environment.ProcessorCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
return Partitioner.Create(0, numChunks, batchSize.Value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
13
Assets/Scripts/NIH/LinqFaster/Utils/CustomPartition.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Utils/CustomPartition.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 117a499c9c8ce1a47a30c4cb3de95a14
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
18
Assets/Scripts/NIH/LinqFaster/Utils/Error.cs
Normal file
18
Assets/Scripts/NIH/LinqFaster/Utils/Error.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
|
||||
internal static class Error
|
||||
{
|
||||
internal static Exception ArgumentNull(string s) { return new ArgumentNullException(s); }
|
||||
|
||||
internal static Exception ArgumentOutOfRange(string s) { return new ArgumentOutOfRangeException(s); }
|
||||
|
||||
internal static Exception MoreThanOneElement() { return new InvalidOperationException("Sequence contains more than one element"); }
|
||||
|
||||
internal static Exception MoreThanOneMatch() { return new InvalidOperationException("Sequence contains more than one matching element"); }
|
||||
|
||||
internal static Exception NoElements() { return new InvalidOperationException("Sequence contains no elements"); }
|
||||
|
||||
internal static Exception NoMatch() { return new InvalidOperationException("Sequence contains no matching element"); }
|
||||
|
||||
internal static Exception NotSupported() { return new NotSupportedException(); }
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Utils/Error.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Utils/Error.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2f77eee1e24f34f438756aca3d8506d9
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
323
Assets/Scripts/NIH/LinqFaster/Utils/GenericOperators.cs
Normal file
323
Assets/Scripts/NIH/LinqFaster/Utils/GenericOperators.cs
Normal file
|
|
@ -0,0 +1,323 @@
|
|||
#if !(UNITY_4 || UNITY_5)
|
||||
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
/*
|
||||
|
||||
C# has no way to constrain a generic to only primitive types.
|
||||
You can only constrain them to value types via:
|
||||
where T : struct
|
||||
All primitives are value types but not all value types are
|
||||
primitives. Thus, when you try to do operations like + > < ==
|
||||
on generic value types, you get a compiler error. These methods
|
||||
work around that by checking the type, casting, and performing the
|
||||
operation. The JIT elides all of the non relevant bits of the If statement
|
||||
for each generic type, so this is remarkably still fast. Since these are
|
||||
only used for the SIMD specific operations, and the SIMD library
|
||||
works exactly this way as well, it does not add any problems that
|
||||
don't already exist when you use .NET SIMD. Which is, if you create a
|
||||
Vector<T> where T is a non primitive value type, you will get a runtime error.
|
||||
*/
|
||||
namespace JM.LinqFaster.Utils
|
||||
{
|
||||
internal static class GenericOperators
|
||||
{
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static T Add<T>(T a, T b)
|
||||
{
|
||||
if (typeof(T) == typeof(Byte))
|
||||
{
|
||||
return (T)(object)((Byte)(object)a + (Byte)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(SByte))
|
||||
{
|
||||
return (T)(object)((SByte)(object)a + (SByte)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt16))
|
||||
{
|
||||
return (T)(object)((UInt16)(object)a + (UInt16)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int16))
|
||||
{
|
||||
return (T)(object)((Int16)(object)a + (Int16)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt32))
|
||||
{
|
||||
return (T)(object)((UInt32)(object)a + (UInt32)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int32))
|
||||
{
|
||||
return (T)(object)((Int32)(object)a + (Int32)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt64))
|
||||
{
|
||||
return (T)(object)((UInt64)(object)a + (UInt64)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int64))
|
||||
{
|
||||
return (T)(object)((Int64)(object)a + (Int64)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Single))
|
||||
{
|
||||
return (T)(object)((Single)(object)a + (Single)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Double))
|
||||
{
|
||||
return (T)(object)((Double)(object)a + (Double)(object)b);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("Nope");
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool GreaterThan<T>(T a, T b)
|
||||
{
|
||||
if (typeof(T) == typeof(Byte))
|
||||
{
|
||||
return ((Byte)(object)a > (Byte)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(SByte))
|
||||
{
|
||||
return ((SByte)(object)a > (SByte)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt16))
|
||||
{
|
||||
return ((UInt16)(object)a > (UInt16)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int16))
|
||||
{
|
||||
return ((Int16)(object)a > (Int16)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt32))
|
||||
{
|
||||
return ((UInt32)(object)a > (UInt32)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int32))
|
||||
{
|
||||
return ((Int32)(object)a > (Int32)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt64))
|
||||
{
|
||||
return ((UInt64)(object)a > (UInt64)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int64))
|
||||
{
|
||||
return ((Int64)(object)a > (Int64)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Single))
|
||||
{
|
||||
return ((Single)(object)a > (Single)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Double))
|
||||
{
|
||||
return ((Double)(object)a > (Double)(object)b);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("Nope");
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool Equals<T>(T a, T b)
|
||||
{
|
||||
if (typeof(T) == typeof(Byte))
|
||||
{
|
||||
return ((Byte)(object)a == (Byte)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(SByte))
|
||||
{
|
||||
return ((SByte)(object)a == (SByte)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt16))
|
||||
{
|
||||
return ((UInt16)(object)a == (UInt16)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int16))
|
||||
{
|
||||
return ((Int16)(object)a == (Int16)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt32))
|
||||
{
|
||||
return ((UInt32)(object)a == (UInt32)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int32))
|
||||
{
|
||||
return ((Int32)(object)a == (Int32)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt64))
|
||||
{
|
||||
return ((UInt64)(object)a == (UInt64)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int64))
|
||||
{
|
||||
return ((Int64)(object)a == (Int64)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Single))
|
||||
{
|
||||
return ((Single)(object)a == (Single)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Double))
|
||||
{
|
||||
return ((Double)(object)a == (Double)(object)b);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("Nope");
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static bool LessThan<T>(T a, T b)
|
||||
{
|
||||
if (typeof(T) == typeof(Byte))
|
||||
{
|
||||
return ((Byte)(object)a < (Byte)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(SByte))
|
||||
{
|
||||
return ((SByte)(object)a < (SByte)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt16))
|
||||
{
|
||||
return ((UInt16)(object)a < (UInt16)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int16))
|
||||
{
|
||||
return ((Int16)(object)a < (Int16)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt32))
|
||||
{
|
||||
return ((UInt32)(object)a < (UInt32)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int32))
|
||||
{
|
||||
return ((Int32)(object)a < (Int32)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt64))
|
||||
{
|
||||
return ((UInt64)(object)a < (UInt64)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int64))
|
||||
{
|
||||
return ((Int64)(object)a < (Int64)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Single))
|
||||
{
|
||||
return ((Single)(object)a < (Single)(object)b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Double))
|
||||
{
|
||||
return ((Double)(object)a < (Double)(object)b);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("Nope");
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static double Divide<T>(T a, double b)
|
||||
{
|
||||
if (typeof(T) == typeof(Byte))
|
||||
{
|
||||
return (double)(object)((Byte)(object)a /b) ;
|
||||
}
|
||||
else if (typeof(T) == typeof(SByte))
|
||||
{
|
||||
return (double)(object)((SByte)(object)a /b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt16))
|
||||
{
|
||||
return (double)(object)((UInt16)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int16))
|
||||
{
|
||||
return (double)(object)((Int16)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt32))
|
||||
{
|
||||
return (double)(object)((UInt32)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int32))
|
||||
{
|
||||
return (double)(object)((Int32)(object)a /b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt64))
|
||||
{
|
||||
return (double)(object)((UInt64)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int64))
|
||||
{
|
||||
return (double)(object)((Int64)(object)a /b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Single))
|
||||
{
|
||||
return (double)(object)((Single)(object)a /b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Double))
|
||||
{
|
||||
return (double)(object)((Double)(object)a / b);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("Nope");
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float DivideFloat<T>(T a, float b)
|
||||
{
|
||||
if (typeof(T) == typeof(Byte))
|
||||
{
|
||||
return (float)(object)((Byte)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(SByte))
|
||||
{
|
||||
return (float)(object)((SByte)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt16))
|
||||
{
|
||||
return (float)(object)((UInt16)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int16))
|
||||
{
|
||||
return (float)(object)((Int16)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt32))
|
||||
{
|
||||
return (float)(object)((UInt32)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int32))
|
||||
{
|
||||
return (float)(object)((Int32)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(UInt64))
|
||||
{
|
||||
return (float)(object)((UInt64)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Int64))
|
||||
{
|
||||
return (float)(object)((Int64)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Single))
|
||||
{
|
||||
return (float)(object)((Single)(object)a / b);
|
||||
}
|
||||
else if (typeof(T) == typeof(Double))
|
||||
{
|
||||
return (float)(object)((Double)(object)a / b);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("Nope");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
13
Assets/Scripts/NIH/LinqFaster/Utils/GenericOperators.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Utils/GenericOperators.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: c55248b8089617346a6a1b22dc43009f
|
||||
timeCreated: 1518622478
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
127
Assets/Scripts/NIH/LinqFaster/Where.cs
Normal file
127
Assets/Scripts/NIH/LinqFaster/Where.cs
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Filters a sequence of values based on a predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to filter.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>A sequence that contains elements from the input sequence that satisfy the condition.</returns>
|
||||
public static T[] WhereF<T>(this T[] source, Func<T, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
T[] result = new T[source.Length];
|
||||
int idx = 0;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
result[idx] = source[i];
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
Array.Resize(ref result, idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filters a sequence of values based on a predicate that includes the index in it's logic.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to filter.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition along with the element's index.</param>
|
||||
/// <returns>A sequence that contains elements from the input sequence that satisfy the condition.</returns>
|
||||
public static T[] WhereF<T>(this T[] source, Func<T, int, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
|
||||
T[] result = new T[source.Length];
|
||||
int idx = 0;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i], i))
|
||||
{
|
||||
result[idx] = source[i];
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
Array.Resize(ref result, idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Filters a sequence of values based on a predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to filter.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition.</param>
|
||||
/// <returns>A sequence that contains elements from the input sequence that satisfy the condition.</returns>
|
||||
public static List<T> WhereF<T>(this List<T> source, Predicate<T> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
return source.FindAll(predicate);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Filters a sequence of values based on a predicate that includes the index in it's logic.
|
||||
/// </summary>
|
||||
/// <param name="source">A sequence to filter.</param>
|
||||
/// <param name="predicate">A function to test each element for a condition along with the element's index.</param>
|
||||
/// <returns>A sequence that contains elements from the input sequence that satisfy the condition.</returns>
|
||||
public static List<T> WhereF<T>(this List<T> source, Func<T, int, bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
List<T> r = new List<T>();
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i], i)) r.Add(source[i]);
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Where.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Where.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 089655aa3554c044c827c1c259eb1e00
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
335
Assets/Scripts/NIH/LinqFaster/WhereAggregate.cs
Normal file
335
Assets/Scripts/NIH/LinqFaster/WhereAggregate.cs
Normal file
|
|
@ -0,0 +1,335 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// ----------------------------- Arrays ------------------
|
||||
|
||||
/// <summary>
|
||||
/// Combines Where and Aggregate for optimal performance
|
||||
/// </summary>
|
||||
/// <param name="source">The input to filter then aggregate.</param>
|
||||
/// <param name="predicate">The function to filter the input sequence with.</param>
|
||||
/// <param name="func">The function to aggregate the filtered seqeuence.</param>
|
||||
/// <returns>The filtered then aggregated sequence.</returns>
|
||||
public static T WhereAggregateF<T>(this T[] source, Func<T, bool> predicate, Func<T, T, T> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
var result = default(T);
|
||||
|
||||
int i = 0;
|
||||
for (; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
result = source[i];
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
result = func(result, source[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines Where and Aggregate with index for optimal performance
|
||||
/// </summary>
|
||||
/// <param name="source">The input to filter then aggregate.</param>
|
||||
/// <param name="predicate">The function to filter the input sequence and it's index with.</param>
|
||||
/// <param name="func">The function to aggregate the filtered seqeuence.</param>
|
||||
/// <returns>The filtered then aggregated sequence.</returns>
|
||||
public static T WhereAggregateF<T>(this T[] source, Func<T, int, bool> predicate, Func<T, T,T> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = default(T);
|
||||
|
||||
int i = 0;
|
||||
for (; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i], i))
|
||||
{
|
||||
result = source[i];
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i], i))
|
||||
{
|
||||
result = func(result, source[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines Where and Aggregate for optimal performance with a starting seed.
|
||||
/// </summary>
|
||||
/// <param name="source">The input to filter then aggregate.</param>
|
||||
/// <param name="predicate">The function to filter the input sequence with.</param>
|
||||
/// <param name="seed">The initial value to aggregate on.</param>
|
||||
/// <param name="func">The function to aggregate the filtered seqeuence.</param>
|
||||
/// <returns>The filtered then aggregated sequence.</returns>
|
||||
public static TAccumulate WhereAggregateF<TSource, TAccumulate>(this TSource[] source, Func<TSource, bool> predicate, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
TAccumulate result = seed;
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
result = func(result, v);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines Where and Aggregate for optimal performance with a starting seed and a result transformation.
|
||||
/// </summary>
|
||||
/// <param name="source">The input to filter then aggregate.</param>
|
||||
/// <param name="predicate">The function to filter the input sequence with.</param>
|
||||
/// <param name="seed">The initial value to aggregate on.</param>
|
||||
/// <param name="func">The function to aggregate the filtered seqeuence.</param>
|
||||
/// <param name="resultSelector">A function to transform the final result.</param>
|
||||
/// <returns>The filtered then aggregated then transformed sequence.</returns>
|
||||
public static TResult WhereAggregateF<TSource, TAccumulate, TResult>(this TSource[] source, Func<TSource, bool> predicate, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
if (resultSelector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("resultSelector");
|
||||
}
|
||||
|
||||
TAccumulate result = seed;
|
||||
int count = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v)) {
|
||||
result = func(result, v);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return resultSelector(result);
|
||||
}
|
||||
|
||||
|
||||
// --------------------------- Lists -------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Combines Where and Aggregate for optimal performance
|
||||
/// </summary>
|
||||
/// <param name="source">The input to filter then aggregate.</param>
|
||||
/// <param name="predicate">The function to filter the input sequence with.</param>
|
||||
/// <param name="func">The function to aggregate the filtered seqeuence.</param>
|
||||
/// <returns>The filtered then aggregated sequence.</returns>
|
||||
public static T WhereAggregateF<T>(this List<T> source, Func<T, bool> predicate, Func<T, T, T> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
var result = default(T);
|
||||
|
||||
int i = 0;
|
||||
for (; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
result = source[i];
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
result = func(result, source[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines Where and Aggregate with index for optimal performance
|
||||
/// </summary>
|
||||
/// <param name="source">The input to filter then aggregate.</param>
|
||||
/// <param name="predicate">The function to filter the input sequence and it's index with.</param>
|
||||
/// <param name="func">The function to aggregate the filtered seqeuence.</param>
|
||||
/// <returns>The filtered then aggregated sequence.</returns>
|
||||
public static T WhereAggregateF<T>(this List<T> source, Func<T, int, bool> predicate, Func<T, T, T> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = default(T);
|
||||
|
||||
int i = 0;
|
||||
for (; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i], i))
|
||||
{
|
||||
result = source[i];
|
||||
i++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i], i))
|
||||
{
|
||||
result = func(result, source[i]);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines Where and Aggregate for optimal performance with a starting seed.
|
||||
/// </summary>
|
||||
/// <param name="source">The input to filter then aggregate.</param>
|
||||
/// <param name="predicate">The function to filter the input sequence with.</param>
|
||||
/// <param name="seed">The initial value to aggregate on.</param>
|
||||
/// <param name="func">The function to aggregate the filtered seqeuence.</param>
|
||||
/// <returns>The filtered then aggregated sequence.</returns>
|
||||
public static TAccumulate WhereAggregateF<TSource, TAccumulate>(this List<TSource> source, Func<TSource, bool> predicate, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
TAccumulate result = seed;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = source[i];
|
||||
if (predicate(v))
|
||||
result = func(result, v);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combines Where and Aggregate for optimal performance with a starting seed and a result transformation.
|
||||
/// </summary>
|
||||
/// <param name="source">The input to filter then aggregate.</param>
|
||||
/// <param name="predicate">The function to filter the input sequence with.</param>
|
||||
/// <param name="seed">The initial value to aggregate on.</param>
|
||||
/// <param name="func">The function to aggregate the filtered seqeuence.</param>
|
||||
/// <param name="resultSelector">A function to transform the final result.</param>
|
||||
/// <returns>The filtered then aggregated then transformed sequence.</returns>
|
||||
public static TResult WhereAggregateF<TSource, TAccumulate, TResult>(this List<TSource> source, Func<TSource, bool> predicate, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (func == null)
|
||||
{
|
||||
throw Error.ArgumentNull("func");
|
||||
}
|
||||
|
||||
if (resultSelector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("resultSelector");
|
||||
}
|
||||
|
||||
TAccumulate result = seed;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var v = source[i];
|
||||
if (predicate(v))
|
||||
result = func(result, v);
|
||||
}
|
||||
return resultSelector(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/WhereAggregate.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/WhereAggregate.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ba74d3462bb50a647b34d3988b598cda
|
||||
timeCreated: 1518622477
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
164
Assets/Scripts/NIH/LinqFaster/WhereSelect.cs
Normal file
164
Assets/Scripts/NIH/LinqFaster/WhereSelect.cs
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Combined Where and Select for optimal performance.
|
||||
/// </summary>
|
||||
/// <param name="source">The input sequence to filter then transform.</param>
|
||||
/// <param name="predicate">A function to use to filter the sequence.</param>
|
||||
/// <param name="selector">A function to transform the filtered elements.</param>
|
||||
/// <returns>A sequence of filtered and transformed elements.</returns>
|
||||
public static TResult[] WhereSelectF<T, TResult>(this T[] source, Func<T, bool> predicate, Func<T, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = new TResult[source.Length];
|
||||
int idx = 0;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i]))
|
||||
{
|
||||
result[idx] = selector(source[i]);
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
Array.Resize(ref result, idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combined Where and Select for optimal performance that uses the index in the
|
||||
/// predicate and selector.
|
||||
/// </summary>
|
||||
/// <param name="source">The input sequence to filter then transform.</param>
|
||||
/// <param name="predicate">A function to use to filter the sequence.</param>
|
||||
/// <param name="selector">A function to transform the filtered elements.</param>
|
||||
/// <returns>A sequence of filtered and transformed elements.</returns>
|
||||
public static TResult[] WhereSelectF<T, TResult>(this T[] source, Func<T, int, bool> predicate, Func<T, int, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var result = new TResult[source.Length];
|
||||
int idx = 0;
|
||||
for (int i = 0; i < source.Length; i++)
|
||||
{
|
||||
if (predicate(source[i], i))
|
||||
{
|
||||
result[idx] = selector(source[i], idx);
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
Array.Resize(ref result, idx);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Combined Where and Select for optimal performance.
|
||||
/// </summary>
|
||||
/// <param name="source">The input sequence to filter then transform.</param>
|
||||
/// <param name="predicate">A function to use to filter the sequence.</param>
|
||||
/// <param name="selector">A function to transform the filtered elements.</param>
|
||||
/// <returns>A sequence of filtered and transformed elements.</returns>
|
||||
public static List<TResult> WhereSelectF<T, TResult>(this List<T> source, Func<T, bool> predicate, Func<T, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var r = new List<TResult>();
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i])) r.Add(selector(source[i]));
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Combined Where and Select for optimal performance that uses the index in the
|
||||
/// predicate and selector.
|
||||
/// </summary>
|
||||
/// <param name="source">The input sequence to filter then transform.</param>
|
||||
/// <param name="predicate">A function to use to filter the sequence.</param>
|
||||
/// <param name="selector">A function to transform the filtered elements.</param>
|
||||
/// <returns>A sequence of filtered and transformed elements.</returns>
|
||||
public static List<TResult> WhereSelectF<T, TResult>(this List<T> source, Func<T, int, bool> predicate, Func<T, int, TResult> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (predicate == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("predicate");
|
||||
}
|
||||
|
||||
var r = new List<TResult>();
|
||||
int idx = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
if (predicate(source[i], i)) {
|
||||
r.Add(selector(source[i], idx));
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/WhereSelect.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/WhereSelect.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 20a5c369792516b4f8326236fc378f5c
|
||||
timeCreated: 1518622476
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
594
Assets/Scripts/NIH/LinqFaster/WhereSum.cs
Normal file
594
Assets/Scripts/NIH/LinqFaster/WhereSum.cs
Normal file
|
|
@ -0,0 +1,594 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
// -------------------------- ARRAYS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static int WhereSumF(this int[] source, Func<int,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
int sum = 0;
|
||||
checked
|
||||
{
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static int WhereSumF<T>(this T[] source,Func<T,bool> predicate, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
int sum = 0;
|
||||
checked
|
||||
{
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static long WhereSumF(this long[] source,Func<long,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static long WhereSumF<T>(this T[] source,Func<T,bool> predicate, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static float WhereSumF(this float[] source, Func<float,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
double sum = 0;
|
||||
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
|
||||
return (float)sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static float WhereSumF<T>(this T[] source, Func<T,bool> predicate,Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
}
|
||||
|
||||
return (float)sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static double WhereSumF(this double[] source, Func<double,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
double sum = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static double WhereSumF<T>(this T[] source, Func<T,bool> predicate,Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static decimal WhereSumF(this decimal[] source, Func<decimal,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
decimal sum = 0;
|
||||
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static decimal WhereSumF<T>(this T[] source,Func<T,bool> predicate, Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
decimal sum = 0;
|
||||
foreach (var v in source)
|
||||
{
|
||||
if (predicate(v))
|
||||
{
|
||||
sum += selector(v);
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
// -------------------------- LISTS --------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static int WhereSumF(this List<int> source, Func<int,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
int sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += s;
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static int WhereSumF<T>(this List<T> source, Func<T,bool> predicate, Func<T, int> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
int sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += selector(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static long WhereSumF(this List<long> source, Func<long,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += s;
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static long WhereSumF<T>(this List<T> source, Func<T,bool> predicate, Func<T, long> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
long sum = 0;
|
||||
checked
|
||||
{
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += selector(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static float WhereSumF(this List<float> source, Func<float,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
double sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += s;
|
||||
}
|
||||
}
|
||||
|
||||
return (float)sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static float WhereSumF<T>(this List<T> source, Func<T,bool> predicate,Func<T, float> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += selector(s);
|
||||
}
|
||||
}
|
||||
|
||||
return (float)sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static double WhereSumF(this List<double> source, Func<double,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
double sum = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += s;
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static double WhereSumF<T>(this List<T> source,Func<T,bool> predicate, Func<T, double> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
double sum = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += selector(s);
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the values in the sequence that match the where predicate.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence to add.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <returns>The sum of the sequence.</returns>
|
||||
public static decimal WhereSumF(this List<decimal> source, Func<decimal,bool> predicate)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
decimal sum = 0;
|
||||
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += s;
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Performs a filter with the where predicate, then sums the transformed values.
|
||||
/// </summary>
|
||||
/// <param name="source">The sequence of values to transform then sum.</param>
|
||||
/// <param name="predicate">A function to filter the sequence with before summing.</param>
|
||||
/// <param name="selector">A transformation function.</param>
|
||||
/// <returns>The sum of the transformed elements.</returns>
|
||||
public static decimal WhereSumF<T>(this List<T> source, Func<T,bool> predicate,Func<T, decimal> selector)
|
||||
{
|
||||
if (source == null)
|
||||
{
|
||||
throw Error.ArgumentNull("source");
|
||||
}
|
||||
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
decimal sum = 0;
|
||||
for (int i = 0; i < source.Count; i++)
|
||||
{
|
||||
var s = source[i];
|
||||
if (predicate(s))
|
||||
{
|
||||
sum += selector(s);
|
||||
}
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/WhereSum.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/WhereSum.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dcc2e4320bd136e4aaecbc9978013e58
|
||||
timeCreated: 1518622478
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
99
Assets/Scripts/NIH/LinqFaster/Zip.cs
Normal file
99
Assets/Scripts/NIH/LinqFaster/Zip.cs
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace JM.LinqFaster
|
||||
{
|
||||
public static partial class LinqFaster
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.
|
||||
/// </summary>
|
||||
/// <param name="first">The first sequence to merge.</param>
|
||||
/// <param name="second">The second sequence to merge.</param>
|
||||
/// <param name="selector">A function that specifies how to merge the elements from the two sequences.</param>
|
||||
/// <returns>A sequence that contains merged elements of two input sequences.</returns>
|
||||
public static R[] ZipF<T, U, R>(this T[] first, U[] second, Func<T, U, R> selector)
|
||||
{
|
||||
if (first == null)
|
||||
{
|
||||
throw Error.ArgumentNull("first");
|
||||
}
|
||||
if (second == null)
|
||||
{
|
||||
throw Error.ArgumentNull("second");
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
//maintain array bounds elision
|
||||
if (first.Length < second.Length)
|
||||
{
|
||||
var result = new R[first.Length];
|
||||
for (int i = 0; i < first.Length; i++)
|
||||
{
|
||||
result[i] = selector(first[i], second[i]);
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = new R[second.Length];
|
||||
for (int i = 0; i < second.Length; i++)
|
||||
{
|
||||
result[i] = selector(first[i], second[i]);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results.
|
||||
/// </summary>
|
||||
/// <param name="first">The first sequence to merge.</param>
|
||||
/// <param name="second">The second sequence to merge.</param>
|
||||
/// <param name="selector">A function that specifies how to merge the elements from the two sequences.</param>
|
||||
/// <returns>A sequence that contains merged elements of two input sequences.</returns>
|
||||
public static List<R> ZipF<T, U, R>(this List<T> first, List<U> second, Func<T, U, R> selector)
|
||||
{
|
||||
if (first == null)
|
||||
{
|
||||
throw Error.ArgumentNull("first");
|
||||
}
|
||||
if (second == null)
|
||||
{
|
||||
throw Error.ArgumentNull("second");
|
||||
}
|
||||
if (selector == null)
|
||||
{
|
||||
throw Error.ArgumentNull("selector");
|
||||
}
|
||||
|
||||
//maintain array bounds elision
|
||||
if (first.Count < second.Count)
|
||||
{
|
||||
var result = new List<R>(first.Count);
|
||||
for (int i = 0; i < first.Count; i++)
|
||||
{
|
||||
result.Add(selector(first[i], second[i]));
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var result = new List<R>(second.Count);
|
||||
for (int i = 0; i < second.Count; i++)
|
||||
{
|
||||
result.Add(selector(first[i], second[i]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
13
Assets/Scripts/NIH/LinqFaster/Zip.cs.meta
Normal file
13
Assets/Scripts/NIH/LinqFaster/Zip.cs.meta
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d5cec6dd8a8dd0b4ab39e3fd25d1fa7b
|
||||
timeCreated: 1518622478
|
||||
licenseType: Free
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
68
Assets/Scripts/NIH/LinqFaster/readme.txt
Normal file
68
Assets/Scripts/NIH/LinqFaster/readme.txt
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
LinqFaster
|
||||
|
||||
|
||||
Usage Guide
|
||||
--------------------------------------------------------------------------
|
||||
LinqFaster provides specialized versions of the Linq extensions methods
|
||||
optimized for working with arrays and lists. LinqFaster methods use the
|
||||
same names as Linq, but with an F (for Fast) appended to them so that
|
||||
you can use LinqFaster alongside regular Linq. The semantics are identical
|
||||
except for OrderBy which does not do a stable sort like Linq does.
|
||||
|
||||
Examples
|
||||
--------------------------------------------------------------------------
|
||||
//Create an array of with values -500 to 500
|
||||
var myArray = LinqFaster.RangeArrayF(-500, 500);
|
||||
//Create a List<T> with 1000 elements all set to 5.0
|
||||
var myList = LinqFaster.RepeatListF(5.0, 1000);
|
||||
|
||||
//Compute sum, average, max,min
|
||||
var sum = myArray.SumF();
|
||||
var average = myArray.AverageF();
|
||||
var min = myArray.Min();
|
||||
var max = myArray.Max();
|
||||
|
||||
//As above but on a transformation
|
||||
var sum2 = myArray.SumF(x => x*x);
|
||||
var average2 = myArray.AverageF(x => x*x);
|
||||
var min2 = myArray.Min(x => x*x);
|
||||
var max2 = myArray.Max(x => x*x);
|
||||
|
||||
//Do a where and a select or select and where in a single pass
|
||||
var newArray = myArray.WhereSelectF(x => x % 2 == 0,x=>x*x);
|
||||
var newArray2 = myArray.SelectWhereF(x => x * x,x => x % 2 == 0);
|
||||
|
||||
//Compute the sum of only the even values in a single pass
|
||||
var filteredSum = myArray.WhereAggregateF(x => x % 2 == 0, (acc, x) => acc + x);
|
||||
|
||||
//New in-place methods are provided where appropriate
|
||||
myArray.SelectInPlace(x => x * x);
|
||||
myArray.ReverseInPlace();
|
||||
|
||||
|
||||
Limitations
|
||||
--------------------------------------------------------------------------
|
||||
These are purely imperative implementations of the same higher order
|
||||
functions that Linq provides, but unlike Linq they are not lazily evaluated.
|
||||
This means that when chaining functions together such as:
|
||||
|
||||
var a = data.Where(predicate).Select(transform).Aggregate(foo);
|
||||
// or
|
||||
var b = data.Select(selector).Sum();
|
||||
|
||||
Linq would not do any work until the calls to Sum() or Aggregate(), and thus
|
||||
iterate over the collection only once and allocate very little. LinqFaster
|
||||
used this way would iterate over the collection each time and allocate much
|
||||
more. Sometimes the net result will still be faster overall but the better
|
||||
approach is to use the combined LinqFaster operations such as
|
||||
SelectWhere, WhereSelect, and WhereAggregate. For example the expressions
|
||||
above would become:
|
||||
|
||||
var a = data.WhereAggregate(predicate,transform,foo);
|
||||
// and
|
||||
var b = data.Sum(selector);
|
||||
|
||||
This gets you the best of both worlds. The speed of memory locality and no
|
||||
allocations at all. In short, think about how you are transforming your
|
||||
data. In some cases normal Linq may be the better choice.
|
||||
|
||||
9
Assets/Scripts/NIH/LinqFaster/readme.txt.meta
Normal file
9
Assets/Scripts/NIH/LinqFaster/readme.txt.meta
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
fileFormatVersion: 2
|
||||
guid: b03cc13e7e812ab47b88f91d54b43c4d
|
||||
timeCreated: 1518622496
|
||||
licenseType: Free
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Scripts/NIH/MIConvexHull.meta
Normal file
8
Assets/Scripts/NIH/MIConvexHull.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4a109a0b0bb6e8f40935ca2ec55e5bd7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
113
Assets/Scripts/NIH/MIConvexHull/Cell2.cs
Normal file
113
Assets/Scripts/NIH/MIConvexHull/Cell2.cs
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using MIConvexHull;
|
||||
|
||||
/// <summary>
|
||||
/// A vertex is a simple class that stores the postion of a point, node or vertex.
|
||||
/// </summary>
|
||||
public class Cell2 : TriangulationCell<Vertex2, Cell2>
|
||||
{
|
||||
Vector2? circumCenter, centroid;
|
||||
|
||||
public Vector2 Circumcenter {
|
||||
get {
|
||||
circumCenter = circumCenter ?? GetCircumcenter();
|
||||
return circumCenter.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public Vector2 Centroid {
|
||||
get {
|
||||
centroid = centroid ?? GetCentroid();
|
||||
return centroid.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public Cell2 ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
double LengthSquared (double[] v)
|
||||
{
|
||||
double norm = 0;
|
||||
for (int i = 0; i < v.Length; i++) {
|
||||
var t = v [i];
|
||||
norm += t * t;
|
||||
}
|
||||
return norm;
|
||||
}
|
||||
|
||||
double Determinant(double[,] m)
|
||||
{
|
||||
double fCofactor00 = m[1,1] * m[2,2] - m[1,2] * m[2,1];
|
||||
double fCofactor10 = m[1,2] * m[2,0] - m[1,0] * m[2,2];
|
||||
double fCofactor20 = m[1,0] * m[2,1] - m[1,1] * m[2,0];
|
||||
|
||||
double fDet = m[0,0] * fCofactor00 + m[0,1] * fCofactor10 + m[0,2] * fCofactor20;
|
||||
|
||||
return fDet;
|
||||
}
|
||||
|
||||
Vector2 GetCircumcenter ()
|
||||
{
|
||||
// From MathWorld: http://mathworld.wolfram.com/Circumcircle.html
|
||||
|
||||
var points = Vertices;
|
||||
|
||||
double[,] m = new double[3, 3];
|
||||
|
||||
// x, y, 1
|
||||
for (int i = 0; i < 3; i++) {
|
||||
m[i, 0] = points[i].x;
|
||||
m[i, 1] = points[i].y;
|
||||
m[i, 2] = 1;
|
||||
}
|
||||
var a = Determinant(m);
|
||||
|
||||
// size, y, 1
|
||||
for (int i = 0; i < 3; i++) {
|
||||
m[i, 0] = points[i].StoredPosition.sqrMagnitude;
|
||||
}
|
||||
var dx = -Determinant(m);
|
||||
|
||||
// size, x, 1
|
||||
for (int i = 0; i < 3; i++) {
|
||||
m[i, 1] = points[i].x;
|
||||
}
|
||||
var dy = Determinant(m);
|
||||
|
||||
// size, x, y
|
||||
//for (int i = 0; i < 3; i++) {
|
||||
// m[i, 2] = points[i].y;
|
||||
//}
|
||||
//var c = -Det(m);
|
||||
|
||||
var s = -1.0 / (2.0 * a);
|
||||
//var r = System.Math.Abs(s) * System.Math.Sqrt(dx * dx + dy * dy - 4 * a * c);
|
||||
|
||||
return new Vector2((float)(s * dx), (float)(s * dy));
|
||||
}
|
||||
|
||||
Vector2 GetCentroid ()
|
||||
{
|
||||
return new Vector2((float)Vertices.Select(v => v.Position[0]).Average(), (float)Vertices.Select(v => v.Position[1]).Average());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
11
Assets/Scripts/NIH/MIConvexHull/Cell2.cs.meta
Normal file
11
Assets/Scripts/NIH/MIConvexHull/Cell2.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: adf902e96e0c51049b65bc002d6ef4ca
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
46
Assets/Scripts/NIH/MIConvexHull/Constants.cs
Normal file
46
Assets/Scripts/NIH/MIConvexHull/Constants.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace MIConvexHull
|
||||
{
|
||||
internal static class Constants
|
||||
{
|
||||
/// <summary>
|
||||
/// The default plane distance tolerance
|
||||
/// </summary>
|
||||
internal const double DefaultPlaneDistanceTolerance = 1e-10;
|
||||
/// <summary>
|
||||
/// The starting delta dot product in simplex
|
||||
/// </summary>
|
||||
internal const double StartingDeltaDotProductInSimplex = 0.5;
|
||||
/// <summary>
|
||||
/// The connector table size
|
||||
/// </summary>
|
||||
internal const int ConnectorTableSize = 2017;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/NIH/MIConvexHull/Constants.cs.meta
Normal file
11
Assets/Scripts/NIH/MIConvexHull/Constants.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ee065f025d2f5374db2ceaa973b822d4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
135
Assets/Scripts/NIH/MIConvexHull/ConvexHull.cs
Normal file
135
Assets/Scripts/NIH/MIConvexHull/ConvexHull.cs
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MIConvexHull
|
||||
{
|
||||
/// <summary>
|
||||
/// Factory class for computing convex hulls.
|
||||
/// </summary>
|
||||
public static class ConvexHull
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a convex hull of the input data.
|
||||
/// </summary>
|
||||
/// <typeparam name="TVertex">The type of the t vertex.</typeparam>
|
||||
/// <typeparam name="TFace">The type of the t face.</typeparam>
|
||||
/// <param name="data">The data.</param>
|
||||
/// <param name="PlaneDistanceTolerance">The plane distance tolerance (default is 1e-10). If too high, points
|
||||
/// will be missed. If too low, the algorithm may break. Only adjust if you notice problems.</param>
|
||||
/// <returns>
|
||||
/// ConvexHull<TVertex, TFace>.
|
||||
/// </returns>
|
||||
public static ConvexHull<TVertex, TFace> Create<TVertex, TFace>(IList<TVertex> data,
|
||||
double PlaneDistanceTolerance = Constants.DefaultPlaneDistanceTolerance)
|
||||
where TVertex : IVertex
|
||||
where TFace : ConvexFace<TVertex, TFace>, new()
|
||||
{
|
||||
return ConvexHull<TVertex, TFace>.Create(data, PlaneDistanceTolerance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a convex hull of the input data.
|
||||
/// </summary>
|
||||
/// <typeparam name="TVertex">The type of the t vertex.</typeparam>
|
||||
/// <param name="data">The data.</param>
|
||||
/// <param name="PlaneDistanceTolerance">The plane distance tolerance (default is 1e-10). If too high, points
|
||||
/// will be missed. If too low, the algorithm may break. Only adjust if you notice problems.</param>
|
||||
/// <returns>
|
||||
/// ConvexHull<TVertex, DefaultConvexFace<TVertex>>.
|
||||
/// </returns>
|
||||
public static ConvexHull<TVertex, DefaultConvexFace<TVertex>> Create<TVertex>(IList<TVertex> data,
|
||||
double PlaneDistanceTolerance = Constants.DefaultPlaneDistanceTolerance)
|
||||
where TVertex : IVertex
|
||||
{
|
||||
return ConvexHull<TVertex, DefaultConvexFace<TVertex>>.Create(data, PlaneDistanceTolerance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a convex hull of the input data.
|
||||
/// </summary>
|
||||
/// <param name="data">The data.</param>
|
||||
/// <param name="PlaneDistanceTolerance">The plane distance tolerance (default is 1e-10). If too high, points
|
||||
/// will be missed. If too low, the algorithm may break. Only adjust if you notice problems.</param>
|
||||
/// <returns>
|
||||
/// ConvexHull<DefaultVertex, DefaultConvexFace<DefaultVertex>>.
|
||||
/// </returns>
|
||||
public static ConvexHull<DefaultVertex, DefaultConvexFace<DefaultVertex>> Create(IList<double[]> data,
|
||||
double PlaneDistanceTolerance = Constants.DefaultPlaneDistanceTolerance)
|
||||
{
|
||||
var points = data.Select(p => new DefaultVertex { Position = p }).ToList();
|
||||
return ConvexHull<DefaultVertex, DefaultConvexFace<DefaultVertex>>.Create(points, PlaneDistanceTolerance);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Representation of a convex hull.
|
||||
/// </summary>
|
||||
/// <typeparam name="TVertex">The type of the t vertex.</typeparam>
|
||||
/// <typeparam name="TFace">The type of the t face.</typeparam>
|
||||
public class ConvexHull<TVertex, TFace>
|
||||
where TVertex : IVertex
|
||||
where TFace : ConvexFace<TVertex, TFace>, new()
|
||||
{
|
||||
/// <summary>
|
||||
/// Can only be created using a factory method.
|
||||
/// </summary>
|
||||
internal ConvexHull()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Points of the convex hull.
|
||||
/// </summary>
|
||||
/// <value>The points.</value>
|
||||
public IEnumerable<TVertex> Points { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Faces of the convex hull.
|
||||
/// </summary>
|
||||
/// <value>The faces.</value>
|
||||
public IEnumerable<TFace> Faces { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates the convex hull.
|
||||
/// </summary>
|
||||
/// <param name="data">The data.</param>
|
||||
/// <param name="PlaneDistanceTolerance">The plane distance tolerance.</param>
|
||||
/// <returns>
|
||||
/// ConvexHull<TVertex, TFace>.
|
||||
/// </returns>
|
||||
/// <exception cref="System.ArgumentNullException">The supplied data is null.</exception>
|
||||
/// <exception cref="ArgumentNullException">data</exception>
|
||||
public static ConvexHull<TVertex, TFace> Create(IList<TVertex> data, double PlaneDistanceTolerance)
|
||||
{
|
||||
if (data == null) throw new ArgumentNullException("The supplied data is null.");
|
||||
return ConvexHullAlgorithm.GetConvexHull<TVertex, TFace>(data, PlaneDistanceTolerance);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/NIH/MIConvexHull/ConvexHull.cs.meta
Normal file
11
Assets/Scripts/NIH/MIConvexHull/ConvexHull.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 447289e858e19c14abbe91dfbd0e3089
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
Assets/Scripts/NIH/MIConvexHull/ConvexHull.meta
Normal file
8
Assets/Scripts/NIH/MIConvexHull/ConvexHull.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a6e88469e3b81a541a0bc8a66e60d0c7
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
304
Assets/Scripts/NIH/MIConvexHull/ConvexHull/Collections.cs
Normal file
304
Assets/Scripts/NIH/MIConvexHull/ConvexHull/Collections.cs
Normal file
|
|
@ -0,0 +1,304 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace MIConvexHull
|
||||
{
|
||||
/// <summary>
|
||||
/// A more lightweight alternative to List of T.
|
||||
/// On clear, only resets the count and does not clear the references
|
||||
/// => this works because of the ObjectManager.
|
||||
/// Includes a stack functionality.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
internal class SimpleList<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// The capacity
|
||||
/// </summary>
|
||||
private int capacity;
|
||||
|
||||
/// <summary>
|
||||
/// The count
|
||||
/// </summary>
|
||||
public int Count;
|
||||
/// <summary>
|
||||
/// The items
|
||||
/// </summary>
|
||||
private T[] items;
|
||||
|
||||
/// <summary>
|
||||
/// Get the i-th element.
|
||||
/// </summary>
|
||||
/// <param name="i">The i.</param>
|
||||
/// <returns>T.</returns>
|
||||
public T this[int i]
|
||||
{
|
||||
get { return items[i]; }
|
||||
set { items[i] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Size matters.
|
||||
/// </summary>
|
||||
private void EnsureCapacity()
|
||||
{
|
||||
if (capacity == 0)
|
||||
{
|
||||
capacity = 32;
|
||||
items = new T[32];
|
||||
}
|
||||
else
|
||||
{
|
||||
var newItems = new T[capacity*2];
|
||||
Array.Copy(items, newItems, capacity);
|
||||
capacity = 2*capacity;
|
||||
items = newItems;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a vertex to the buffer.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
public void Add(T item)
|
||||
{
|
||||
if (Count + 1 > capacity) EnsureCapacity();
|
||||
items[Count++] = item;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pushes the value to the back of the list.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
public void Push(T item)
|
||||
{
|
||||
if (Count + 1 > capacity) EnsureCapacity();
|
||||
items[Count++] = item;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pops the last value from the list.
|
||||
/// </summary>
|
||||
/// <returns>T.</returns>
|
||||
public T Pop()
|
||||
{
|
||||
return items[--Count];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the Count to 0, otherwise does nothing.
|
||||
/// </summary>
|
||||
public void Clear()
|
||||
{
|
||||
Count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Class IndexBuffer.
|
||||
/// A fancy name for a list of integers.
|
||||
/// </summary>
|
||||
internal class IndexBuffer : SimpleList<int>
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A priority based linked list.
|
||||
/// </summary>
|
||||
internal sealed class FaceList
|
||||
{
|
||||
/// <summary>
|
||||
/// The last
|
||||
/// </summary>
|
||||
private ConvexFaceInternal last;
|
||||
|
||||
/// <summary>
|
||||
/// Get the first element.
|
||||
/// </summary>
|
||||
/// <value>The first.</value>
|
||||
public ConvexFaceInternal First { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Adds the element to the beginning.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
private void AddFirst(ConvexFaceInternal face)
|
||||
{
|
||||
face.InList = true;
|
||||
First.Previous = face;
|
||||
face.Next = First;
|
||||
First = face;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a face to the list.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
public void Add(ConvexFaceInternal face)
|
||||
{
|
||||
if (face.InList)
|
||||
{
|
||||
if (First.VerticesBeyond.Count < face.VerticesBeyond.Count)
|
||||
{
|
||||
Remove(face);
|
||||
AddFirst(face);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
face.InList = true;
|
||||
|
||||
if (First != null && First.VerticesBeyond.Count < face.VerticesBeyond.Count)
|
||||
{
|
||||
First.Previous = face;
|
||||
face.Next = First;
|
||||
First = face;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (last != null)
|
||||
{
|
||||
last.Next = face;
|
||||
}
|
||||
face.Previous = last;
|
||||
last = face;
|
||||
if (First == null)
|
||||
{
|
||||
First = face;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the element from the list.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
public void Remove(ConvexFaceInternal face)
|
||||
{
|
||||
if (!face.InList) return;
|
||||
|
||||
face.InList = false;
|
||||
|
||||
if (face.Previous != null)
|
||||
{
|
||||
face.Previous.Next = face.Next;
|
||||
}
|
||||
else if ( /*first == face*/ face.Previous == null)
|
||||
{
|
||||
First = face.Next;
|
||||
}
|
||||
|
||||
if (face.Next != null)
|
||||
{
|
||||
face.Next.Previous = face.Previous;
|
||||
}
|
||||
else if ( /*last == face*/ face.Next == null)
|
||||
{
|
||||
last = face.Previous;
|
||||
}
|
||||
|
||||
face.Next = null;
|
||||
face.Previous = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Connector list.
|
||||
/// </summary>
|
||||
internal sealed class ConnectorList
|
||||
{
|
||||
/// <summary>
|
||||
/// The last
|
||||
/// </summary>
|
||||
private FaceConnector last;
|
||||
|
||||
/// <summary>
|
||||
/// Get the first element.
|
||||
/// </summary>
|
||||
/// <value>The first.</value>
|
||||
public FaceConnector First { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Adds the element to the beginning.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
private void AddFirst(FaceConnector connector)
|
||||
{
|
||||
First.Previous = connector;
|
||||
connector.Next = First;
|
||||
First = connector;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a face to the list.
|
||||
/// </summary>
|
||||
/// <param name="element">The element.</param>
|
||||
public void Add(FaceConnector element)
|
||||
{
|
||||
if (last != null)
|
||||
{
|
||||
last.Next = element;
|
||||
}
|
||||
element.Previous = last;
|
||||
last = element;
|
||||
if (First == null)
|
||||
{
|
||||
First = element;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the element from the list.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
public void Remove(FaceConnector connector)
|
||||
{
|
||||
if (connector.Previous != null)
|
||||
{
|
||||
connector.Previous.Next = connector.Next;
|
||||
}
|
||||
else if ( /*first == face*/ connector.Previous == null)
|
||||
{
|
||||
First = connector.Next;
|
||||
}
|
||||
|
||||
if (connector.Next != null)
|
||||
{
|
||||
connector.Next.Previous = connector.Previous;
|
||||
}
|
||||
else if ( /*last == face*/ connector.Next == null)
|
||||
{
|
||||
last = connector.Previous;
|
||||
}
|
||||
|
||||
connector.Next = null;
|
||||
connector.Previous = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 3969283304824fe4a8eca1eb522fd3a7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
69
Assets/Scripts/NIH/MIConvexHull/ConvexHull/ConvexFace.cs
Normal file
69
Assets/Scripts/NIH/MIConvexHull/ConvexHull/ConvexFace.cs
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
namespace MIConvexHull
|
||||
{
|
||||
/// <summary>
|
||||
/// A convex face representation containing adjacency information.
|
||||
/// </summary>
|
||||
/// <typeparam name="TVertex">The type of the t vertex.</typeparam>
|
||||
/// <typeparam name="TFace">The type of the t face.</typeparam>
|
||||
public abstract class ConvexFace<TVertex, TFace>
|
||||
where TVertex : IVertex
|
||||
where TFace : ConvexFace<TVertex, TFace>
|
||||
{
|
||||
/// <summary>
|
||||
/// Adjacency. Array of length "dimension".
|
||||
/// If F = Adjacency[i] then the vertices shared with F are Vertices[j] where j != i.
|
||||
/// In the context of triangulation, can be null (indicates the cell is at boundary).
|
||||
/// </summary>
|
||||
/// <value>The adjacency.</value>
|
||||
public TFace[] Adjacency { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The vertices stored in clockwise order for dimensions 2 - 4, in higher dimensions the order is arbitrary.
|
||||
/// Unless I accidentally switch some index somewhere in which case the order is CCW. Either way, it is consistent.
|
||||
/// 3D Normal = (V[1] - V[0]) x (V[2] - V[1]).
|
||||
/// </summary>
|
||||
/// <value>The vertices.</value>
|
||||
public TVertex[] Vertices { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The normal vector of the face. Null if used in triangulation.
|
||||
/// </summary>
|
||||
/// <value>The normal.</value>
|
||||
public double[] Normal { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A default convex face representation.
|
||||
/// </summary>
|
||||
/// <typeparam name="TVertex">The type of the t vertex.</typeparam>
|
||||
public class DefaultConvexFace<TVertex> : ConvexFace<TVertex, DefaultConvexFace<TVertex>>
|
||||
where TVertex : IVertex
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5db1a96860ec6d949930695ae9bedcc0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,721 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace MIConvexHull
|
||||
{
|
||||
/*
|
||||
* This part of the implementation handles initialization of the convex hull algorithm:
|
||||
* - Constructor & Process initiation
|
||||
* - Determine the dimension by looking at length of Position vector of 10 random data points from the input.
|
||||
* - Identify bounding box points in each direction.
|
||||
* - Pick (Dimension + 1) points from the extremes and construct the initial simplex.
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Class ConvexHullAlgorithm.
|
||||
/// </summary>
|
||||
internal partial class ConvexHullAlgorithm
|
||||
{
|
||||
#region Starting functions and constructor
|
||||
/// <summary>
|
||||
/// The main function for the Convex Hull algorithm. It is static, but it creates
|
||||
/// an instantiation of this class in order to allow for parallel execution.
|
||||
/// Following this simple function, the constructor and the main function "FindConvexHull" is listed.
|
||||
/// </summary>
|
||||
/// <typeparam name="TVertex">The type of the vertices in the data.</typeparam>
|
||||
/// <typeparam name="TFace">The desired type of the faces.</typeparam>
|
||||
/// <param name="data">The data is the vertices as a collection of IVertices.</param>
|
||||
/// <param name="PlaneDistanceTolerance">The plane distance tolerance.</param>
|
||||
/// <returns>
|
||||
/// MIConvexHull.ConvexHull<TVertex, TFace>.
|
||||
/// </returns>
|
||||
internal static ConvexHull<TVertex, TFace> GetConvexHull<TVertex, TFace>(IList<TVertex> data,
|
||||
double PlaneDistanceTolerance)
|
||||
where TFace : ConvexFace<TVertex, TFace>, new()
|
||||
where TVertex : IVertex
|
||||
{
|
||||
var ch = new ConvexHullAlgorithm(data.Cast<IVertex>().ToArray(), false, PlaneDistanceTolerance);
|
||||
ch.GetConvexHull();
|
||||
|
||||
if (ch.NumOfDimensions == 2) return ch.Return2DResultInOrder<TVertex, TFace>(data);
|
||||
return new ConvexHull<TVertex, TFace>
|
||||
{
|
||||
Points = ch.GetHullVertices(data),
|
||||
Faces = ch.GetConvexFaces<TVertex, TFace>()
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConvexHullAlgorithm" /> class.
|
||||
/// </summary>
|
||||
/// <param name="vertices">The vertices.</param>
|
||||
/// <param name="lift">if set to <c>true</c> [lift].</param>
|
||||
/// <param name="PlaneDistanceTolerance">The plane distance tolerance.</param>
|
||||
/// <exception cref="System.InvalidOperationException">Dimension of the input must be 2 or greater.</exception>
|
||||
/// <exception cref="System.ArgumentException">There are too few vertices (m) for the n-dimensional space. (m must be greater +
|
||||
/// than the n, but m is + NumberOfVertices + and n is + NumOfDimensions</exception>
|
||||
/// <exception cref="InvalidOperationException">PointTranslationGenerator cannot be null if PointTranslationType is enabled.
|
||||
/// or
|
||||
/// Dimension of the input must be 2 or greater.</exception>
|
||||
/// <exception cref="ArgumentException">There are too few vertices (m) for the n-dimensional space. (m must be greater " +
|
||||
/// "than the n, but m is " + NumberOfVertices + " and n is " + Dimension</exception>
|
||||
private ConvexHullAlgorithm(IVertex[] vertices, bool lift, double PlaneDistanceTolerance)
|
||||
{
|
||||
IsLifted = lift;
|
||||
Vertices = vertices;
|
||||
NumberOfVertices = vertices.Length;
|
||||
|
||||
NumOfDimensions = DetermineDimension();
|
||||
if (IsLifted) NumOfDimensions++;
|
||||
if (NumOfDimensions < 2) throw new InvalidOperationException("Dimension of the input must be 2 or greater.");
|
||||
if (NumberOfVertices <= NumOfDimensions)
|
||||
throw new ArgumentException(
|
||||
"There are too few vertices (m) for the n-dimensional space. (m must be greater " +
|
||||
"than the n, but m is " + NumberOfVertices + " and n is " + NumOfDimensions);
|
||||
this.PlaneDistanceTolerance = PlaneDistanceTolerance;
|
||||
UnprocessedFaces = new FaceList();
|
||||
ConvexFaces = new IndexBuffer();
|
||||
|
||||
FacePool = new ConvexFaceInternal[(NumOfDimensions + 1) * 10]; // must be initialized before object manager
|
||||
AffectedFaceFlags = new bool[(NumOfDimensions + 1) * 10];
|
||||
ObjectManager = new ObjectManager(this);
|
||||
|
||||
Center = new double[NumOfDimensions];
|
||||
TraverseStack = new IndexBuffer();
|
||||
UpdateBuffer = new int[NumOfDimensions];
|
||||
UpdateIndices = new int[NumOfDimensions];
|
||||
EmptyBuffer = new IndexBuffer();
|
||||
AffectedFaceBuffer = new IndexBuffer();
|
||||
ConeFaceBuffer = new SimpleList<DeferredFace>();
|
||||
SingularVertices = new HashSet<int>();
|
||||
BeyondBuffer = new IndexBuffer();
|
||||
|
||||
ConnectorTable = new ConnectorList[Constants.ConnectorTableSize];
|
||||
for (var i = 0; i < Constants.ConnectorTableSize; i++) ConnectorTable[i] = new ConnectorList();
|
||||
|
||||
VertexVisited = new bool[NumberOfVertices];
|
||||
Positions = new double[NumberOfVertices * NumOfDimensions];
|
||||
boundingBoxPoints = new List<int>[NumOfDimensions];
|
||||
minima = new double[NumOfDimensions];
|
||||
maxima = new double[NumOfDimensions];
|
||||
mathHelper = new MathHelper(NumOfDimensions, Positions);
|
||||
}
|
||||
/// <summary>
|
||||
/// Check the dimensionality of the input data.
|
||||
/// </summary>
|
||||
/// <returns>System.Int32.</returns>
|
||||
/// <exception cref="ArgumentException">Invalid input data (non-uniform dimension).</exception>
|
||||
private int DetermineDimension()
|
||||
{
|
||||
var r = new Random();
|
||||
var dimensions = new List<int>();
|
||||
for (var i = 0; i < 10; i++)
|
||||
dimensions.Add(Vertices[r.Next(NumberOfVertices)].Position.Length);
|
||||
var dimension = dimensions.Min();
|
||||
if (dimension != dimensions.Max())
|
||||
throw new ArgumentException("Invalid input data (non-uniform dimension).");
|
||||
return dimension;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets/calculates the convex hull. This is
|
||||
/// </summary>
|
||||
private void GetConvexHull()
|
||||
{
|
||||
// accessing a 1D array is quicker than a jagged array, so the first step is to make this array
|
||||
SerializeVerticesToPositions();
|
||||
// next the bounding box extremes are found. This is used to shift, scale and find the starting simplex.
|
||||
FindBoundingBoxPoints();
|
||||
// the positions are shifted to avoid divide by zero problems
|
||||
// and if Delaunay or Voronoi, then the parabola terms are scaled back to match the size of the other coords
|
||||
ShiftAndScalePositions();
|
||||
// Find the (dimension+1) initial points and create the simplexes.
|
||||
CreateInitialSimplex();
|
||||
|
||||
// Now, the main loop. These initial faces of a simplex are replaced and expanded
|
||||
// outwards to make the convex hull and faces.
|
||||
while (UnprocessedFaces.First != null)
|
||||
{
|
||||
var currentFace = UnprocessedFaces.First;
|
||||
CurrentVertex = currentFace.FurthestVertex;
|
||||
|
||||
UpdateCenter();
|
||||
|
||||
// The affected faces get tagged
|
||||
TagAffectedFaces(currentFace);
|
||||
|
||||
// Create the cone from the currentVertex and the affected faces horizon.
|
||||
if (!SingularVertices.Contains(CurrentVertex) && CreateCone()) CommitCone();
|
||||
else HandleSingular();
|
||||
|
||||
// Need to reset the tags
|
||||
var count = AffectedFaceBuffer.Count;
|
||||
for (var i = 0; i < count; i++) AffectedFaceFlags[AffectedFaceBuffer[i]] = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Serializes the vertices into the 1D array, Positions. The 1D array has much quicker access in C#.
|
||||
/// </summary>
|
||||
private void SerializeVerticesToPositions()
|
||||
{
|
||||
var index = 0;
|
||||
if (IsLifted) // "Lifted" means that the last dimension is the sum of the squares of the others.
|
||||
{
|
||||
foreach (var v in Vertices)
|
||||
{
|
||||
var parabolaTerm = 0.0; // the lifted term is a sum of squares.
|
||||
var origNumDim = NumOfDimensions - 1;
|
||||
for (var i = 0; i < origNumDim; i++)
|
||||
{
|
||||
var coordinate = v.Position[i];
|
||||
Positions[index++] = coordinate;
|
||||
parabolaTerm += coordinate * coordinate;
|
||||
}
|
||||
Positions[index++] = parabolaTerm;
|
||||
}
|
||||
}
|
||||
else
|
||||
foreach (var v in Vertices)
|
||||
{
|
||||
for (var i = 0; i < NumOfDimensions; i++)
|
||||
Positions[index++] = v.Position[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Finds the bounding box points.
|
||||
/// </summary>
|
||||
private void FindBoundingBoxPoints()
|
||||
{
|
||||
indexOfDimensionWithLeastExtremes = -1;
|
||||
var minNumExtremes = int.MaxValue;
|
||||
for (var i = 0; i < NumOfDimensions; i++)
|
||||
{
|
||||
var minIndices = new List<int>();
|
||||
var maxIndices = new List<int>();
|
||||
double min = double.PositiveInfinity, max = double.NegativeInfinity;
|
||||
for (var j = 0; j < NumberOfVertices; j++)
|
||||
{
|
||||
var v = GetCoordinate(j, i);
|
||||
var difference = min - v;
|
||||
if (difference >= PlaneDistanceTolerance)
|
||||
{
|
||||
// you found a better solution than before, clear out the list and store new value
|
||||
min = v;
|
||||
minIndices.Clear();
|
||||
minIndices.Add(j);
|
||||
}
|
||||
else if (difference > 0)
|
||||
{
|
||||
// you found a solution slightly better than before, clear out those that are no longer on the list and store new value
|
||||
min = v;
|
||||
minIndices.RemoveAll(index => min - GetCoordinate(index, i) > PlaneDistanceTolerance);
|
||||
minIndices.Add(j);
|
||||
}
|
||||
else if (difference > -PlaneDistanceTolerance)
|
||||
{
|
||||
//same or almost as good as current limit, so store it
|
||||
minIndices.Add(j);
|
||||
}
|
||||
difference = v - max;
|
||||
if (difference >= PlaneDistanceTolerance)
|
||||
{
|
||||
// you found a better solution than before, clear out the list and store new value
|
||||
max = v;
|
||||
maxIndices.Clear();
|
||||
maxIndices.Add(j);
|
||||
}
|
||||
else if (difference > 0)
|
||||
{
|
||||
// you found a solution slightly better than before, clear out those that are no longer on the list and store new value
|
||||
max = v;
|
||||
maxIndices.RemoveAll(index => min - GetCoordinate(index, i) > PlaneDistanceTolerance);
|
||||
maxIndices.Add(j);
|
||||
}
|
||||
else if (difference > -PlaneDistanceTolerance)
|
||||
{
|
||||
//same or almost as good as current limit, so store it
|
||||
maxIndices.Add(j);
|
||||
}
|
||||
}
|
||||
minima[i] = min;
|
||||
maxima[i] = max;
|
||||
minIndices.AddRange(maxIndices);
|
||||
if (minIndices.Count < minNumExtremes)
|
||||
{
|
||||
minNumExtremes = minIndices.Count;
|
||||
indexOfDimensionWithLeastExtremes = i;
|
||||
}
|
||||
boundingBoxPoints[i] = minIndices;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shifts and scales the Positions to avoid future errors. This does not alter the original data.
|
||||
/// </summary>
|
||||
private void ShiftAndScalePositions()
|
||||
{
|
||||
var positionsLength = Positions.Length;
|
||||
if (IsLifted)
|
||||
{
|
||||
var origNumDim = NumOfDimensions - 1;
|
||||
var parabolaScale = 2 / (minima.Sum(x => Math.Abs(x)) + maxima.Sum(x => Math.Abs(x))
|
||||
- Math.Abs(maxima[origNumDim]) - Math.Abs(minima[origNumDim]));
|
||||
// the parabola scale is 1 / average of the sum of the other dimensions.
|
||||
// multiplying this by the parabola will scale it back to be on near similar size to the
|
||||
// other dimensions. Without this, the term is much larger than the others, which causes
|
||||
// problems for roundoff error and finding the normal of faces.
|
||||
minima[origNumDim] *= parabolaScale; // change the extreme values as well
|
||||
maxima[origNumDim] *= parabolaScale;
|
||||
// it is done here because
|
||||
for (int i = origNumDim; i < positionsLength; i += NumOfDimensions)
|
||||
Positions[i] *= parabolaScale;
|
||||
}
|
||||
var shiftAmount = new double[NumOfDimensions];
|
||||
for (int i = 0; i < NumOfDimensions; i++)
|
||||
// now the entire model is shifted to all positive numbers...plus some more.
|
||||
// why?
|
||||
// 1) to avoid dealing with a point at the origin {0,0,...,0} which causes problems
|
||||
// for future normal finding
|
||||
// 2) note that weird shift that is used (max - min - min). This is to avoid scaling
|
||||
// issues. this shift means that the minima in a dimension will always be a positive
|
||||
// number (no points at zero), and the minima [in a given dimension] will always be
|
||||
// half of the maxima. 'Half' is much preferred to 'thousands of times'
|
||||
// Think of the first term as the range (max - min), then the second term avoids cases
|
||||
// where there are both positive and negative numbers.
|
||||
if (maxima[i] == minima[i]) shiftAmount[i] = 0.0;
|
||||
else shiftAmount[i] = (maxima[i] - minima[i]) - minima[i];
|
||||
for (int i = 0; i < positionsLength; i++)
|
||||
Positions[i] += shiftAmount[i % NumOfDimensions];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find the (dimension+1) initial points and create the simplexes.
|
||||
/// Creates the initial simplex of n+1 vertices by using points from the bounding box.
|
||||
/// Special care is taken to ensure that the vertices chosen do not result in a degenerate shape
|
||||
/// where vertices are collinear (co-planar, etc). This would technically be resolved when additional
|
||||
/// vertices are checked in the main loop, but: 1) a degenerate simplex would not eliminate any other
|
||||
/// vertices (thus no savings there), 2) the creation of the face normal is prone to error.
|
||||
/// </summary>
|
||||
private void CreateInitialSimplex()
|
||||
{
|
||||
var initialPoints = FindInitialPoints();
|
||||
#region Create the first faces from (dimension + 1) vertices.
|
||||
|
||||
var faces = new int[NumOfDimensions + 1];
|
||||
|
||||
for (var i = 0; i < NumOfDimensions + 1; i++)
|
||||
{
|
||||
var vertices = new int[NumOfDimensions];
|
||||
for (int j = 0, k = 0; j <= NumOfDimensions; j++)
|
||||
{
|
||||
if (i != j) vertices[k++] = initialPoints[j];
|
||||
}
|
||||
var newFace = FacePool[ObjectManager.GetFace()];
|
||||
newFace.Vertices = vertices;
|
||||
Array.Sort(vertices);
|
||||
mathHelper.CalculateFacePlane(newFace, Center);
|
||||
faces[i] = newFace.Index;
|
||||
}
|
||||
// update the adjacency (check all pairs of faces)
|
||||
for (var i = 0; i < NumOfDimensions; i++)
|
||||
for (var j = i + 1; j < NumOfDimensions + 1; j++) UpdateAdjacency(FacePool[faces[i]], FacePool[faces[j]]);
|
||||
|
||||
#endregion
|
||||
|
||||
#region Init the vertex beyond buffers.
|
||||
|
||||
foreach (var faceIndex in faces)
|
||||
{
|
||||
var face = FacePool[faceIndex];
|
||||
FindBeyondVertices(face);
|
||||
if (face.VerticesBeyond.Count == 0) ConvexFaces.Add(face.Index); // The face is on the hull
|
||||
else UnprocessedFaces.Add(face);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
// Set all vertices to false (unvisited).
|
||||
foreach (var vertex in initialPoints) VertexVisited[vertex] = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds (dimension + 1) initial points.
|
||||
/// </summary>
|
||||
/// <returns>List<System.Int32>.</returns>
|
||||
/// <exception cref="System.ArgumentException">The input data is degenerate. It appears to exist in " + NumOfDimensions +
|
||||
/// " dimensions, but it is a " + (NumOfDimensions - 1) + " dimensional set (i.e. the point of collinear,"
|
||||
/// + " coplanar, or co-hyperplanar.)</exception>
|
||||
private List<int> FindInitialPoints()
|
||||
{
|
||||
var bigNumber = maxima.Sum() * NumOfDimensions * NumberOfVertices;
|
||||
// the first two points are taken from the dimension that had the fewest extremes
|
||||
// well, in most cases there will only be 2 in all dimensions: one min and one max
|
||||
// but a lot of engineering part shapes are nice and square and can have hundreds of
|
||||
// parallel vertices at the extremes
|
||||
var vertex1 = boundingBoxPoints[indexOfDimensionWithLeastExtremes].First(); // these are min and max vertices along
|
||||
var vertex2 = boundingBoxPoints[indexOfDimensionWithLeastExtremes].Last(); // the dimension that had the fewest points
|
||||
boundingBoxPoints[indexOfDimensionWithLeastExtremes].RemoveAt(0);
|
||||
boundingBoxPoints[indexOfDimensionWithLeastExtremes].RemoveAt(boundingBoxPoints[indexOfDimensionWithLeastExtremes].Count - 1);
|
||||
var initialPoints = new List<int> { vertex1, vertex2 };
|
||||
VertexVisited[vertex1] = VertexVisited[vertex2] = true;
|
||||
CurrentVertex = vertex1; UpdateCenter();
|
||||
CurrentVertex = vertex2; UpdateCenter();
|
||||
var edgeVectors = new double[NumOfDimensions][];
|
||||
edgeVectors[0] = mathHelper.VectorBetweenVertices(vertex2, vertex1);
|
||||
// now the remaining vertices are just combined in one big list
|
||||
var extremes = boundingBoxPoints.SelectMany(x => x).ToList();
|
||||
// otherwise find the remaining points by maximizing the initial simplex volume
|
||||
var index = 1;
|
||||
while (index < NumOfDimensions && extremes.Any())
|
||||
{
|
||||
var bestVertex = -1;
|
||||
var bestEdgeVector = new double[] { };
|
||||
var maxVolume = Constants.DefaultPlaneDistanceTolerance;
|
||||
for (var i = extremes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// count backwards in order to remove potential duplicates
|
||||
var vIndex = extremes[i];
|
||||
if (initialPoints.Contains(vIndex)) extremes.RemoveAt(i);
|
||||
else
|
||||
{
|
||||
edgeVectors[index] = mathHelper.VectorBetweenVertices(vIndex, vertex1);
|
||||
var volume = mathHelper.GetSimplexVolume(edgeVectors, index, bigNumber);
|
||||
if (maxVolume < volume)
|
||||
{
|
||||
maxVolume = volume;
|
||||
bestVertex = vIndex;
|
||||
bestEdgeVector = edgeVectors[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
extremes.Remove(bestVertex);
|
||||
if (bestVertex == -1) break;
|
||||
initialPoints.Add(bestVertex);
|
||||
edgeVectors[index++] = bestEdgeVector;
|
||||
CurrentVertex = bestVertex; UpdateCenter();
|
||||
}
|
||||
// hmm, there are not enough points on the bounding box to make a simplex. It is rare but entirely possibly.
|
||||
// As an extreme, the bounding box can be made in n dimensions from only 2 unique points. When we can't find
|
||||
// enough unique points, we start again with ALL the vertices. The following is a near replica of the code
|
||||
// above, but instead of extremes, we consider "allVertices".
|
||||
if (initialPoints.Count <= NumOfDimensions && !IsLifted)
|
||||
{
|
||||
var allVertices = Enumerable.Range(0, NumberOfVertices).ToList();
|
||||
while (index < NumOfDimensions && allVertices.Any())
|
||||
{
|
||||
var bestVertex = -1;
|
||||
var bestEdgeVector = new double[] { };
|
||||
var maxVolume = 0.0;
|
||||
for (var i = allVertices.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// count backwards in order to remove potential duplicates
|
||||
var vIndex = allVertices[i];
|
||||
if (initialPoints.Contains(vIndex)) allVertices.RemoveAt(i);
|
||||
else
|
||||
{
|
||||
edgeVectors[index] = mathHelper.VectorBetweenVertices(vIndex, vertex1);
|
||||
var volume = mathHelper.GetSimplexVolume(edgeVectors, index, bigNumber);
|
||||
if (maxVolume < volume)
|
||||
{
|
||||
maxVolume = volume;
|
||||
bestVertex = vIndex;
|
||||
bestEdgeVector = edgeVectors[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
allVertices.Remove(bestVertex);
|
||||
if (bestVertex == -1) break;
|
||||
initialPoints.Add(bestVertex);
|
||||
edgeVectors[index++] = bestEdgeVector;
|
||||
CurrentVertex = bestVertex; UpdateCenter();
|
||||
}
|
||||
}
|
||||
if (initialPoints.Count <= NumOfDimensions && IsLifted)
|
||||
{
|
||||
var allVertices = Enumerable.Range(0, NumberOfVertices).ToList();
|
||||
while (index < NumOfDimensions && allVertices.Any())
|
||||
{
|
||||
var bestVertex = -1;
|
||||
var bestEdgeVector = new double[] { };
|
||||
var maxVolume = 0.0;
|
||||
for (var i = allVertices.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// count backwards in order to remove potential duplicates
|
||||
var vIndex = allVertices[i];
|
||||
if (initialPoints.Contains(vIndex)) allVertices.RemoveAt(i);
|
||||
else
|
||||
{
|
||||
mathHelper.RandomOffsetToLift(vIndex, maxima.Last()-minima.Last());
|
||||
edgeVectors[index] = mathHelper.VectorBetweenVertices(vIndex, vertex1);
|
||||
var volume = mathHelper.GetSimplexVolume(edgeVectors, index, bigNumber);
|
||||
if (maxVolume < volume)
|
||||
{
|
||||
maxVolume = volume;
|
||||
bestVertex = vIndex;
|
||||
bestEdgeVector = edgeVectors[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
allVertices.Remove(bestVertex);
|
||||
if (bestVertex == -1) break;
|
||||
initialPoints.Add(bestVertex);
|
||||
edgeVectors[index++] = bestEdgeVector;
|
||||
CurrentVertex = bestVertex; UpdateCenter();
|
||||
}
|
||||
}
|
||||
if (initialPoints.Count <= NumOfDimensions && IsLifted)
|
||||
throw new ArgumentException("The input data is degenerate. It appears to exist in " + NumOfDimensions +
|
||||
" dimensions, but it is a " + (NumOfDimensions - 1) + " dimensional set (i.e. the point of collinear,"
|
||||
+ " coplanar, or co-hyperplanar.)");
|
||||
return initialPoints;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if 2 faces are adjacent and if so, update their AdjacentFaces array.
|
||||
/// </summary>
|
||||
/// <param name="l">The l.</param>
|
||||
/// <param name="r">The r.</param>
|
||||
private void UpdateAdjacency(ConvexFaceInternal l, ConvexFaceInternal r)
|
||||
{
|
||||
var lv = l.Vertices;
|
||||
var rv = r.Vertices;
|
||||
int i;
|
||||
|
||||
// reset marks on the 1st face
|
||||
for (i = 0; i < lv.Length; i++) VertexVisited[lv[i]] = false;
|
||||
|
||||
// mark all vertices on the 2nd face
|
||||
for (i = 0; i < rv.Length; i++) VertexVisited[rv[i]] = true;
|
||||
|
||||
// find the 1st false index
|
||||
for (i = 0; i < lv.Length; i++) if (!VertexVisited[lv[i]]) break;
|
||||
|
||||
// no vertex was marked
|
||||
if (i == NumOfDimensions) return;
|
||||
|
||||
// check if only 1 vertex wasn't marked
|
||||
for (var j = i + 1; j < lv.Length; j++) if (!VertexVisited[lv[j]]) return;
|
||||
|
||||
// if we are here, the two faces share an edge
|
||||
l.AdjacentFaces[i] = r.Index;
|
||||
|
||||
// update the adj. face on the other face - find the vertex that remains marked
|
||||
for (i = 0; i < lv.Length; i++) VertexVisited[lv[i]] = false;
|
||||
for (i = 0; i < rv.Length; i++)
|
||||
{
|
||||
if (VertexVisited[rv[i]]) break;
|
||||
}
|
||||
r.AdjacentFaces[i] = l.Index;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used in the "initialization" code.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
private void FindBeyondVertices(ConvexFaceInternal face)
|
||||
{
|
||||
var beyondVertices = face.VerticesBeyond;
|
||||
MaxDistance = double.NegativeInfinity;
|
||||
FurthestVertex = 0;
|
||||
for (var i = 0; i < NumberOfVertices; i++)
|
||||
{
|
||||
if (VertexVisited[i]) continue;
|
||||
IsBeyond(face, beyondVertices, i);
|
||||
}
|
||||
|
||||
face.FurthestVertex = FurthestVertex;
|
||||
}
|
||||
#region Fields
|
||||
|
||||
/// <summary>
|
||||
/// Corresponds to the dimension of the data.
|
||||
/// When the "lifted" hull is computed, Dimension is automatically incremented by one.
|
||||
/// </summary>
|
||||
internal readonly int NumOfDimensions;
|
||||
|
||||
/// <summary>
|
||||
/// Are we on a paraboloid?
|
||||
/// </summary>
|
||||
private readonly bool IsLifted;
|
||||
|
||||
/// <summary>
|
||||
/// Explained in ConvexHullComputationConfig.
|
||||
/// </summary>
|
||||
private readonly double PlaneDistanceTolerance;
|
||||
|
||||
/*
|
||||
* Representation of the input vertices.
|
||||
*
|
||||
* - In the algorithm, a vertex is represented by its index in the Vertices array.
|
||||
* This makes the algorithm a lot faster (up to 30%) than using object reference everywhere.
|
||||
* - Positions are stored as a single array of values. Coordinates for vertex with index i
|
||||
* are stored at indices <i * Dimension, (i + 1) * Dimension)
|
||||
* - VertexMarks are used by the algorithm to help identify a set of vertices that is "above" (or "beyond")
|
||||
* a specific face.
|
||||
*/
|
||||
/// <summary>
|
||||
/// The vertices
|
||||
/// </summary>
|
||||
private readonly IVertex[] Vertices;
|
||||
/// <summary>
|
||||
/// The positions
|
||||
/// </summary>
|
||||
private double[] Positions;
|
||||
/// <summary>
|
||||
/// The vertex marks
|
||||
/// </summary>
|
||||
private readonly bool[] VertexVisited;
|
||||
|
||||
private readonly int NumberOfVertices;
|
||||
|
||||
/*
|
||||
* The triangulation faces are represented in a single pool for objects that are being reused.
|
||||
* This allows for represent the faces as integers and significantly speeds up many computations.
|
||||
* - AffectedFaceFlags are used to mark affected faces/
|
||||
*/
|
||||
/// <summary>
|
||||
/// The face pool
|
||||
/// </summary>
|
||||
internal ConvexFaceInternal[] FacePool;
|
||||
/// <summary>
|
||||
/// The affected face flags
|
||||
/// </summary>
|
||||
internal bool[] AffectedFaceFlags;
|
||||
|
||||
/// <summary>
|
||||
/// Used to track the size of the current hull in the Update/RollbackCenter functions.
|
||||
/// </summary>
|
||||
private int ConvexHullSize;
|
||||
|
||||
/// <summary>
|
||||
/// A list of faces that that are not a part of the final convex hull and still need to be processed.
|
||||
/// </summary>
|
||||
private readonly FaceList UnprocessedFaces;
|
||||
|
||||
/// <summary>
|
||||
/// A list of faces that form the convex hull.
|
||||
/// </summary>
|
||||
private readonly IndexBuffer ConvexFaces;
|
||||
|
||||
/// <summary>
|
||||
/// The vertex that is currently being processed.
|
||||
/// </summary>
|
||||
private int CurrentVertex;
|
||||
|
||||
/// <summary>
|
||||
/// A helper variable to determine the furthest vertex for a particular convex face.
|
||||
/// </summary>
|
||||
private double MaxDistance;
|
||||
|
||||
/// <summary>
|
||||
/// A helper variable to help determine the index of the vertex that is furthest from the face that is currently being
|
||||
/// processed.
|
||||
/// </summary>
|
||||
private int FurthestVertex;
|
||||
|
||||
/// <summary>
|
||||
/// The centroid of the currently computed hull.
|
||||
/// </summary>
|
||||
private readonly double[] Center;
|
||||
|
||||
/*
|
||||
* Helper arrays to store faces for adjacency update.
|
||||
* This is just to prevent unnecessary allocations.
|
||||
*/
|
||||
/// <summary>
|
||||
/// The update buffer
|
||||
/// </summary>
|
||||
private readonly int[] UpdateBuffer;
|
||||
/// <summary>
|
||||
/// The update indices
|
||||
/// </summary>
|
||||
private readonly int[] UpdateIndices;
|
||||
|
||||
/// <summary>
|
||||
/// Used to determine which faces need to be updated at each step of the algorithm.
|
||||
/// </summary>
|
||||
private readonly IndexBuffer TraverseStack;
|
||||
|
||||
/// <summary>
|
||||
/// Used for VerticesBeyond for faces that are on the convex hull.
|
||||
/// </summary>
|
||||
private readonly IndexBuffer EmptyBuffer;
|
||||
|
||||
/// <summary>
|
||||
/// Used to determine which vertices are "above" (or "beyond") a face
|
||||
/// </summary>
|
||||
private IndexBuffer BeyondBuffer;
|
||||
|
||||
/// <summary>
|
||||
/// Stores faces that are visible from the current vertex.
|
||||
/// </summary>
|
||||
private readonly IndexBuffer AffectedFaceBuffer;
|
||||
|
||||
/// <summary>
|
||||
/// Stores faces that form a "cone" created by adding new vertex.
|
||||
/// </summary>
|
||||
private readonly SimpleList<DeferredFace> ConeFaceBuffer;
|
||||
|
||||
/// <summary>
|
||||
/// Stores a list of "singular" (or "generate", "planar", etc.) vertices that cannot be part of the hull.
|
||||
/// </summary>
|
||||
private readonly HashSet<int> SingularVertices;
|
||||
|
||||
/// <summary>
|
||||
/// The connector table helps to determine the adjacency of convex faces.
|
||||
/// Hashing is used instead of pairwise comparison. This significantly speeds up the computations,
|
||||
/// especially for higher dimensions.
|
||||
/// </summary>
|
||||
private readonly ConnectorList[] ConnectorTable;
|
||||
|
||||
/// <summary>
|
||||
/// Manages the memory allocations and storage of unused objects.
|
||||
/// Saves the garbage collector a lot of work.
|
||||
/// </summary>
|
||||
private readonly ObjectManager ObjectManager;
|
||||
|
||||
/// <summary>
|
||||
/// Helper class for handling math related stuff.
|
||||
/// </summary>
|
||||
private readonly MathHelper mathHelper;
|
||||
private readonly List<int>[] boundingBoxPoints;
|
||||
private int indexOfDimensionWithLeastExtremes;
|
||||
private readonly double[] minima;
|
||||
private readonly double[] maxima;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 48bd00cb6ec8d244f90e1c1608f39074
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,635 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MIConvexHull
|
||||
{
|
||||
/*
|
||||
* Main part of the algorithm
|
||||
* Basic idea:
|
||||
* - Create the initial hull (done in Initialize.cs)
|
||||
*
|
||||
* For each face there are "vertices beyond" which are "visible" from it.
|
||||
* If there are no such vertices, the face is on the hull.
|
||||
*
|
||||
* - While there is at least one face with at least one "vertex beyond":
|
||||
* * Pick the furthest beyond vertex
|
||||
* * For this vertex:
|
||||
* > find all faces that are visible from it (TagAffectedFaces)
|
||||
* > remove them and replace them with a "cone" created by the vertex and the boundary
|
||||
* of the affected faces, and for each new face, compute "beyond vertices"
|
||||
* (CreateCone + CommitCone)
|
||||
*
|
||||
* + Implement it in way that is fast, but hard to understand and maintain.
|
||||
*/
|
||||
|
||||
/// <summary>
|
||||
/// Class ConvexHullAlgorithm.
|
||||
/// </summary>
|
||||
internal partial class ConvexHullAlgorithm
|
||||
{
|
||||
/// <summary>
|
||||
/// Tags all faces seen from the current vertex with 1.
|
||||
/// </summary>
|
||||
/// <param name="currentFace">The current face.</param>
|
||||
private void TagAffectedFaces(ConvexFaceInternal currentFace)
|
||||
{
|
||||
AffectedFaceBuffer.Clear();
|
||||
AffectedFaceBuffer.Add(currentFace.Index);
|
||||
TraverseAffectedFaces(currentFace.Index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recursively traverse all the relevant faces.
|
||||
/// </summary>
|
||||
/// <param name="currentFace">The current face.</param>
|
||||
private void TraverseAffectedFaces(int currentFace)
|
||||
{
|
||||
TraverseStack.Clear();
|
||||
TraverseStack.Push(currentFace);
|
||||
AffectedFaceFlags[currentFace] = true;
|
||||
|
||||
while (TraverseStack.Count > 0)
|
||||
{
|
||||
var top = FacePool[TraverseStack.Pop()];
|
||||
for (var i = 0; i < NumOfDimensions; i++)
|
||||
{
|
||||
var adjFace = top.AdjacentFaces[i];
|
||||
|
||||
if (!AffectedFaceFlags[adjFace] &&
|
||||
mathHelper.GetVertexDistance(CurrentVertex, FacePool[adjFace]) >= PlaneDistanceTolerance)
|
||||
{
|
||||
AffectedFaceBuffer.Add(adjFace);
|
||||
AffectedFaceFlags[adjFace] = true;
|
||||
TraverseStack.Push(adjFace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new deferred face.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
/// <param name="faceIndex">Index of the face.</param>
|
||||
/// <param name="pivot">The pivot.</param>
|
||||
/// <param name="pivotIndex">Index of the pivot.</param>
|
||||
/// <param name="oldFace">The old face.</param>
|
||||
/// <returns>DeferredFace.</returns>
|
||||
private DeferredFace MakeDeferredFace(ConvexFaceInternal face, int faceIndex, ConvexFaceInternal pivot,
|
||||
int pivotIndex, ConvexFaceInternal oldFace)
|
||||
{
|
||||
var ret = ObjectManager.GetDeferredFace();
|
||||
|
||||
ret.Face = face;
|
||||
ret.FaceIndex = faceIndex;
|
||||
ret.Pivot = pivot;
|
||||
ret.PivotIndex = pivotIndex;
|
||||
ret.OldFace = oldFace;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Connect faces using a connector.
|
||||
/// </summary>
|
||||
/// <param name="connector">The connector.</param>
|
||||
private void ConnectFace(FaceConnector connector)
|
||||
{
|
||||
var index = connector.HashCode % Constants.ConnectorTableSize;
|
||||
var list = ConnectorTable[index];
|
||||
|
||||
for (var current = list.First; current != null; current = current.Next)
|
||||
{
|
||||
if (FaceConnector.AreConnectable(connector, current, NumOfDimensions))
|
||||
{
|
||||
list.Remove(current);
|
||||
FaceConnector.Connect(current, connector);
|
||||
current.Face = null;
|
||||
connector.Face = null;
|
||||
ObjectManager.DepositConnector(current);
|
||||
ObjectManager.DepositConnector(connector);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
list.Add(connector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the faces "covered" by the current vertex and adds the newly created ones.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
private bool CreateCone()
|
||||
{
|
||||
var currentVertexIndex = CurrentVertex;
|
||||
ConeFaceBuffer.Clear();
|
||||
|
||||
for (var fIndex = 0; fIndex < AffectedFaceBuffer.Count; fIndex++)
|
||||
{
|
||||
var oldFaceIndex = AffectedFaceBuffer[fIndex];
|
||||
var oldFace = FacePool[oldFaceIndex];
|
||||
|
||||
// Find the faces that need to be updated
|
||||
var updateCount = 0;
|
||||
for (var i = 0; i < NumOfDimensions; i++)
|
||||
{
|
||||
var af = oldFace.AdjacentFaces[i];
|
||||
if (!AffectedFaceFlags[af]) // Tag == false when oldFaces does not contain af
|
||||
{
|
||||
UpdateBuffer[updateCount] = af;
|
||||
UpdateIndices[updateCount] = i;
|
||||
++updateCount;
|
||||
}
|
||||
}
|
||||
|
||||
for (var i = 0; i < updateCount; i++)
|
||||
{
|
||||
var adjacentFace = FacePool[UpdateBuffer[i]];
|
||||
|
||||
var oldFaceAdjacentIndex = 0;
|
||||
var adjFaceAdjacency = adjacentFace.AdjacentFaces;
|
||||
for (var j = 0; j < adjFaceAdjacency.Length; j++)
|
||||
{
|
||||
if (oldFaceIndex == adjFaceAdjacency[j])
|
||||
{
|
||||
oldFaceAdjacentIndex = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var forbidden = UpdateIndices[i]; // Index of the face that corresponds to this adjacent face
|
||||
|
||||
int oldVertexIndex;
|
||||
int[] vertices;
|
||||
|
||||
var newFaceIndex = ObjectManager.GetFace();
|
||||
var newFace = FacePool[newFaceIndex];
|
||||
vertices = newFace.Vertices;
|
||||
for (var j = 0; j < NumOfDimensions; j++) vertices[j] = oldFace.Vertices[j];
|
||||
oldVertexIndex = vertices[forbidden];
|
||||
|
||||
int orderedPivotIndex;
|
||||
|
||||
// correct the ordering
|
||||
if (currentVertexIndex < oldVertexIndex)
|
||||
{
|
||||
orderedPivotIndex = 0;
|
||||
for (var j = forbidden - 1; j >= 0; j--)
|
||||
{
|
||||
if (vertices[j] > currentVertexIndex) vertices[j + 1] = vertices[j];
|
||||
else
|
||||
{
|
||||
orderedPivotIndex = j + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
orderedPivotIndex = NumOfDimensions - 1;
|
||||
for (var j = forbidden + 1; j < NumOfDimensions; j++)
|
||||
{
|
||||
if (vertices[j] < currentVertexIndex) vertices[j - 1] = vertices[j];
|
||||
else
|
||||
{
|
||||
orderedPivotIndex = j - 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vertices[orderedPivotIndex] = CurrentVertex;
|
||||
|
||||
if (!mathHelper.CalculateFacePlane(newFace, Center))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ConeFaceBuffer.Add(MakeDeferredFace(newFace, orderedPivotIndex, adjacentFace, oldFaceAdjacentIndex,
|
||||
oldFace));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Commits a cone and adds a vertex to the convex hull.
|
||||
/// </summary>
|
||||
private void CommitCone()
|
||||
{
|
||||
// Fill the adjacency.
|
||||
for (var i = 0; i < ConeFaceBuffer.Count; i++)
|
||||
{
|
||||
var face = ConeFaceBuffer[i];
|
||||
|
||||
var newFace = face.Face;
|
||||
var adjacentFace = face.Pivot;
|
||||
var oldFace = face.OldFace;
|
||||
var orderedPivotIndex = face.FaceIndex;
|
||||
|
||||
newFace.AdjacentFaces[orderedPivotIndex] = adjacentFace.Index;
|
||||
adjacentFace.AdjacentFaces[face.PivotIndex] = newFace.Index;
|
||||
|
||||
// let there be a connection.
|
||||
for (var j = 0; j < NumOfDimensions; j++)
|
||||
{
|
||||
if (j == orderedPivotIndex) continue;
|
||||
var connector = ObjectManager.GetConnector();
|
||||
connector.Update(newFace, j, NumOfDimensions);
|
||||
ConnectFace(connector);
|
||||
}
|
||||
|
||||
// the id adjacent face on the hull? If so, we can use simple method to find beyond vertices.
|
||||
if (adjacentFace.VerticesBeyond.Count == 0)
|
||||
FindBeyondVertices(newFace, oldFace.VerticesBeyond);
|
||||
// it is slightly more effective if the face with the lower number of beyond vertices comes first.
|
||||
else if (adjacentFace.VerticesBeyond.Count < oldFace.VerticesBeyond.Count)
|
||||
FindBeyondVertices(newFace, adjacentFace.VerticesBeyond, oldFace.VerticesBeyond);
|
||||
else
|
||||
FindBeyondVertices(newFace, oldFace.VerticesBeyond, adjacentFace.VerticesBeyond);
|
||||
|
||||
// This face will definitely lie on the hull
|
||||
if (newFace.VerticesBeyond.Count == 0)
|
||||
{
|
||||
ConvexFaces.Add(newFace.Index);
|
||||
UnprocessedFaces.Remove(newFace);
|
||||
ObjectManager.DepositVertexBuffer(newFace.VerticesBeyond);
|
||||
newFace.VerticesBeyond = EmptyBuffer;
|
||||
}
|
||||
else // Add the face to the list
|
||||
{
|
||||
UnprocessedFaces.Add(newFace);
|
||||
}
|
||||
|
||||
// recycle the object.
|
||||
ObjectManager.DepositDeferredFace(face);
|
||||
}
|
||||
|
||||
// Recycle the affected faces.
|
||||
for (var fIndex = 0; fIndex < AffectedFaceBuffer.Count; fIndex++)
|
||||
{
|
||||
var face = AffectedFaceBuffer[fIndex];
|
||||
UnprocessedFaces.Remove(FacePool[face]);
|
||||
ObjectManager.DepositFace(face);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check whether the vertex v is beyond the given face. If so, add it to beyondVertices.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
/// <param name="beyondVertices">The beyond vertices.</param>
|
||||
/// <param name="v">The v.</param>
|
||||
private void IsBeyond(ConvexFaceInternal face, IndexBuffer beyondVertices, int v)
|
||||
{
|
||||
var distance = mathHelper.GetVertexDistance(v, face);
|
||||
if (distance >= PlaneDistanceTolerance)
|
||||
{
|
||||
if (distance > MaxDistance)
|
||||
{
|
||||
// If it's within the tolerance distance, use the lex. larger point
|
||||
if (distance - MaxDistance < PlaneDistanceTolerance)
|
||||
{ // todo: why is this LexCompare necessary. Would seem to favor x over y over z (etc.)?
|
||||
if (LexCompare(v, FurthestVertex) > 0)
|
||||
{
|
||||
MaxDistance = distance;
|
||||
FurthestVertex = v;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MaxDistance = distance;
|
||||
FurthestVertex = v;
|
||||
}
|
||||
}
|
||||
beyondVertices.Add(v);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Compares the values of two vertices. The return value (-1, 0 or +1) are found
|
||||
/// by first checking the first coordinate and then progressing through the rest.
|
||||
/// In this way {2, 8} will be a "-1" (less than) {3, 1}.
|
||||
/// </summary>
|
||||
/// <param name="u">The base vertex index, u.</param>
|
||||
/// <param name="v">The compared vertex index, v.</param>
|
||||
/// <returns>System.Int32.</returns>
|
||||
private int LexCompare(int u, int v)
|
||||
{
|
||||
int uOffset = u * NumOfDimensions, vOffset = v * NumOfDimensions;
|
||||
for (var i = 0; i < NumOfDimensions; i++)
|
||||
{
|
||||
double x = Positions[uOffset + i], y = Positions[vOffset + i];
|
||||
var comp = x.CompareTo(y);
|
||||
if (comp != 0) return comp;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Used by update faces.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
/// <param name="beyond">The beyond.</param>
|
||||
/// <param name="beyond1">The beyond1.</param>
|
||||
private void FindBeyondVertices(ConvexFaceInternal face, IndexBuffer beyond, IndexBuffer beyond1)
|
||||
{
|
||||
var beyondVertices = BeyondBuffer;
|
||||
|
||||
MaxDistance = double.NegativeInfinity;
|
||||
FurthestVertex = 0;
|
||||
int v;
|
||||
|
||||
for (var i = 0; i < beyond1.Count; i++) VertexVisited[beyond1[i]] = true;
|
||||
VertexVisited[CurrentVertex] = false;
|
||||
for (var i = 0; i < beyond.Count; i++)
|
||||
{
|
||||
v = beyond[i];
|
||||
if (v == CurrentVertex) continue;
|
||||
VertexVisited[v] = false;
|
||||
IsBeyond(face, beyondVertices, v);
|
||||
}
|
||||
|
||||
for (var i = 0; i < beyond1.Count; i++)
|
||||
{
|
||||
v = beyond1[i];
|
||||
if (VertexVisited[v]) IsBeyond(face, beyondVertices, v);
|
||||
}
|
||||
|
||||
face.FurthestVertex = FurthestVertex;
|
||||
|
||||
// Pull the old switch a roo (switch the face beyond buffers)
|
||||
var temp = face.VerticesBeyond;
|
||||
face.VerticesBeyond = beyondVertices;
|
||||
if (temp.Count > 0) temp.Clear();
|
||||
BeyondBuffer = temp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds the beyond vertices.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
/// <param name="beyond">The beyond.</param>
|
||||
private void FindBeyondVertices(ConvexFaceInternal face, IndexBuffer beyond)
|
||||
{
|
||||
var beyondVertices = BeyondBuffer;
|
||||
|
||||
MaxDistance = double.NegativeInfinity;
|
||||
FurthestVertex = 0;
|
||||
int v;
|
||||
|
||||
for (var i = 0; i < beyond.Count; i++)
|
||||
{
|
||||
v = beyond[i];
|
||||
if (v == CurrentVertex) continue;
|
||||
IsBeyond(face, beyondVertices, v);
|
||||
}
|
||||
|
||||
face.FurthestVertex = FurthestVertex;
|
||||
|
||||
// Pull the old switch a roo (switch the face beyond buffers)
|
||||
var temp = face.VerticesBeyond;
|
||||
face.VerticesBeyond = beyondVertices;
|
||||
if (temp.Count > 0) temp.Clear();
|
||||
BeyondBuffer = temp;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recalculates the centroid of the current hull.
|
||||
/// </summary>
|
||||
private void UpdateCenter()
|
||||
{
|
||||
for (var i = 0; i < NumOfDimensions; i++) Center[i] *= ConvexHullSize;
|
||||
ConvexHullSize += 1;
|
||||
var f = 1.0 / ConvexHullSize;
|
||||
var co = CurrentVertex * NumOfDimensions;
|
||||
for (var i = 0; i < NumOfDimensions; i++) Center[i] = f * (Center[i] + Positions[co + i]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the last vertex from the center.
|
||||
/// </summary>
|
||||
private void RollbackCenter()
|
||||
{
|
||||
for (var i = 0; i < NumOfDimensions; i++) Center[i] *= ConvexHullSize;
|
||||
ConvexHullSize -= 1;
|
||||
var f = ConvexHullSize > 0 ? 1.0 / ConvexHullSize : 0.0;
|
||||
var co = CurrentVertex * NumOfDimensions;
|
||||
for (var i = 0; i < NumOfDimensions; i++) Center[i] = f * (Center[i] - Positions[co + i]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles singular vertex.
|
||||
/// </summary>
|
||||
private void HandleSingular()
|
||||
{
|
||||
RollbackCenter();
|
||||
SingularVertices.Add(CurrentVertex);
|
||||
|
||||
// This means that all the affected faces must be on the hull and that all their "vertices beyond" are singular.
|
||||
for (var fIndex = 0; fIndex < AffectedFaceBuffer.Count; fIndex++)
|
||||
{
|
||||
var face = FacePool[AffectedFaceBuffer[fIndex]];
|
||||
var vb = face.VerticesBeyond;
|
||||
for (var i = 0; i < vb.Count; i++)
|
||||
{
|
||||
SingularVertices.Add(vb[i]);
|
||||
}
|
||||
|
||||
ConvexFaces.Add(face.Index);
|
||||
UnprocessedFaces.Remove(face);
|
||||
ObjectManager.DepositVertexBuffer(face.VerticesBeyond);
|
||||
face.VerticesBeyond = EmptyBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a vertex coordinate. In order to reduce speed, all vertex coordinates
|
||||
/// have been placed in a single array.
|
||||
/// </summary>
|
||||
/// <param name="vIndex">The vertex index.</param>
|
||||
/// <param name="dimension">The index of the dimension.</param>
|
||||
/// <returns>System.Double.</returns>
|
||||
private double GetCoordinate(int vIndex, int dimension)
|
||||
{
|
||||
return Positions[vIndex * NumOfDimensions + dimension];
|
||||
}
|
||||
|
||||
#region Returning the Results in the proper format
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hull vertices.
|
||||
/// </summary>
|
||||
/// <typeparam name="TVertex">The type of the t vertex.</typeparam>
|
||||
/// <param name="data">The data.</param>
|
||||
/// <returns>TVertex[].</returns>
|
||||
private TVertex[] GetHullVertices<TVertex>(IList<TVertex> data)
|
||||
{
|
||||
var cellCount = ConvexFaces.Count;
|
||||
var hullVertexCount = 0;
|
||||
|
||||
for (var i = 0; i < NumberOfVertices; i++) VertexVisited[i] = false;
|
||||
|
||||
for (var i = 0; i < cellCount; i++)
|
||||
{
|
||||
var vs = FacePool[ConvexFaces[i]].Vertices;
|
||||
for (var j = 0; j < vs.Length; j++)
|
||||
{
|
||||
var v = vs[j];
|
||||
if (!VertexVisited[v])
|
||||
{
|
||||
VertexVisited[v] = true;
|
||||
hullVertexCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var result = new TVertex[hullVertexCount];
|
||||
for (var i = 0; i < NumberOfVertices; i++)
|
||||
{
|
||||
if (VertexVisited[i]) result[--hullVertexCount] = data[i];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Finds the convex hull and creates the TFace objects.
|
||||
/// </summary>
|
||||
/// <typeparam name="TFace">The type of the t face.</typeparam>
|
||||
/// <typeparam name="TVertex">The type of the t vertex.</typeparam>
|
||||
/// <returns>TFace[].</returns>
|
||||
private TFace[] GetConvexFaces<TVertex, TFace>()
|
||||
where TFace : ConvexFace<TVertex, TFace>, new()
|
||||
where TVertex : IVertex
|
||||
{
|
||||
var faces = ConvexFaces;
|
||||
var cellCount = faces.Count;
|
||||
var cells = new TFace[cellCount];
|
||||
|
||||
for (var i = 0; i < cellCount; i++)
|
||||
{
|
||||
var face = FacePool[faces[i]];
|
||||
var vertices = new TVertex[NumOfDimensions];
|
||||
for (var j = 0; j < NumOfDimensions; j++)
|
||||
{
|
||||
vertices[j] = (TVertex)Vertices[face.Vertices[j]];
|
||||
}
|
||||
|
||||
cells[i] = new TFace
|
||||
{
|
||||
Vertices = vertices,
|
||||
Adjacency = new TFace[NumOfDimensions],
|
||||
Normal = IsLifted ? null : face.Normal
|
||||
};
|
||||
face.Tag = i;
|
||||
}
|
||||
|
||||
for (var i = 0; i < cellCount; i++)
|
||||
{
|
||||
var face = FacePool[faces[i]];
|
||||
var cell = cells[i];
|
||||
for (var j = 0; j < NumOfDimensions; j++)
|
||||
{
|
||||
if (face.AdjacentFaces[j] < 0) continue;
|
||||
cell.Adjacency[j] = cells[FacePool[face.AdjacentFaces[j]].Tag];
|
||||
}
|
||||
|
||||
// Fix the vertex orientation.
|
||||
if (face.IsNormalFlipped)
|
||||
{
|
||||
var tempVert = cell.Vertices[0];
|
||||
cell.Vertices[0] = cell.Vertices[NumOfDimensions - 1];
|
||||
cell.Vertices[NumOfDimensions - 1] = tempVert;
|
||||
|
||||
var tempAdj = cell.Adjacency[0];
|
||||
cell.Adjacency[0] = cell.Adjacency[NumOfDimensions - 1];
|
||||
cell.Adjacency[NumOfDimensions - 1] = tempAdj;
|
||||
}
|
||||
}
|
||||
|
||||
return cells;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For 2D only: Returns the result in counter-clockwise order starting with the element with the lowest X value.
|
||||
/// If there are multiple vertices with the same minimum X, then the one with the lowest Y is chosen.
|
||||
/// </summary>
|
||||
/// <typeparam name="TVertex">The type of the vertex.</typeparam>
|
||||
/// <typeparam name="TFace">The type of the face.</typeparam>
|
||||
/// <param name="data">The data.</param>
|
||||
/// <returns></returns>
|
||||
private ConvexHull<TVertex, TFace> Return2DResultInOrder<TVertex, TFace>(IList<TVertex> data)
|
||||
where TVertex : IVertex
|
||||
where TFace : ConvexFace<TVertex, TFace>, new()
|
||||
{
|
||||
TFace[] faces = GetConvexFaces<TVertex, TFace>();
|
||||
var numPoints = faces.Length;
|
||||
var orderDictionary = new Dictionary<TVertex, TFace>();
|
||||
foreach (var face in faces)
|
||||
orderDictionary.Add(face.Vertices[1], face);
|
||||
var firstPoint = faces[0].Vertices[1];
|
||||
var nextPoint = faces[0].Vertices[0];
|
||||
var orderedPointList = new List<TVertex>();
|
||||
orderedPointList.Add(firstPoint);
|
||||
var orderedFaceList = new List<TFace>();
|
||||
orderedFaceList.Add(faces[1]);
|
||||
var lowestXMinIndex = 0;
|
||||
var k = 0;
|
||||
while (!nextPoint.Equals(firstPoint))
|
||||
{
|
||||
orderedPointList.Add(nextPoint);
|
||||
var nextFace = orderDictionary[nextPoint];
|
||||
orderedFaceList.Add(nextFace);
|
||||
if (nextPoint.Position[0] < orderedPointList[lowestXMinIndex].Position[0]
|
||||
|| (nextPoint.Position[0] == orderedPointList[lowestXMinIndex].Position[0]
|
||||
&& nextPoint.Position[1] <= orderedPointList[lowestXMinIndex].Position[1]))
|
||||
lowestXMinIndex = k;
|
||||
k++;
|
||||
nextPoint = nextFace.Vertices[0];
|
||||
}
|
||||
TVertex[] points = new TVertex[numPoints];
|
||||
for (int i = 0; i < numPoints; i++)
|
||||
{
|
||||
var j = (i + lowestXMinIndex) % numPoints;
|
||||
points[i] = orderedPointList[j];
|
||||
faces[i] = orderedFaceList[j];
|
||||
}
|
||||
return new ConvexHull<TVertex, TFace>
|
||||
{
|
||||
Points = points,
|
||||
Faces = faces
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f7f265217d00ea340b87645242a45181
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
237
Assets/Scripts/NIH/MIConvexHull/ConvexHull/DataModel.cs
Normal file
237
Assets/Scripts/NIH/MIConvexHull/ConvexHull/DataModel.cs
Normal file
|
|
@ -0,0 +1,237 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* MIConvexHull, Copyright (c) 2015 David Sehnal, Matthew Campbell
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
namespace MIConvexHull
|
||||
{
|
||||
/// <summary>
|
||||
/// For deferred face addition.
|
||||
/// </summary>
|
||||
internal sealed class DeferredFace
|
||||
{
|
||||
/// <summary>
|
||||
/// The faces.
|
||||
/// </summary>
|
||||
public ConvexFaceInternal Face, Pivot, OldFace;
|
||||
|
||||
/// <summary>
|
||||
/// The indices.
|
||||
/// </summary>
|
||||
public int FaceIndex, PivotIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A helper class used to connect faces.
|
||||
/// </summary>
|
||||
internal sealed class FaceConnector
|
||||
{
|
||||
/// <summary>
|
||||
/// The edge to be connected.
|
||||
/// </summary>
|
||||
public int EdgeIndex;
|
||||
|
||||
/// <summary>
|
||||
/// The face.
|
||||
/// </summary>
|
||||
public ConvexFaceInternal Face;
|
||||
|
||||
/// <summary>
|
||||
/// The hash code computed from indices.
|
||||
/// </summary>
|
||||
public uint HashCode;
|
||||
|
||||
/// <summary>
|
||||
/// Next node in the list.
|
||||
/// </summary>
|
||||
public FaceConnector Next;
|
||||
|
||||
/// <summary>
|
||||
/// Prev node in the list.
|
||||
/// </summary>
|
||||
public FaceConnector Previous;
|
||||
|
||||
/// <summary>
|
||||
/// The vertex indices.
|
||||
/// </summary>
|
||||
public int[] Vertices;
|
||||
|
||||
/// <summary>
|
||||
/// Ctor.
|
||||
/// </summary>
|
||||
/// <param name="dimension">The dimension.</param>
|
||||
public FaceConnector(int dimension)
|
||||
{
|
||||
Vertices = new int[dimension - 1];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the connector.
|
||||
/// </summary>
|
||||
/// <param name="face">The face.</param>
|
||||
/// <param name="edgeIndex">Index of the edge.</param>
|
||||
/// <param name="dim">The dim.</param>
|
||||
public void Update(ConvexFaceInternal face, int edgeIndex, int dim)
|
||||
{
|
||||
Face = face;
|
||||
EdgeIndex = edgeIndex;
|
||||
|
||||
uint hashCode = 23;
|
||||
|
||||
unchecked
|
||||
{
|
||||
var vs = face.Vertices;
|
||||
int i, c = 0;
|
||||
for (i = 0; i < edgeIndex; i++)
|
||||
{
|
||||
Vertices[c++] = vs[i];
|
||||
hashCode += 31*hashCode + (uint) vs[i];
|
||||
}
|
||||
for (i = edgeIndex + 1; i < vs.Length; i++)
|
||||
{
|
||||
Vertices[c++] = vs[i];
|
||||
hashCode += 31*hashCode + (uint) vs[i];
|
||||
}
|
||||
}
|
||||
|
||||
HashCode = hashCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Can two faces be connected.
|
||||
/// </summary>
|
||||
/// <param name="a">a.</param>
|
||||
/// <param name="b">The b.</param>
|
||||
/// <param name="dim">The dim.</param>
|
||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
||||
public static bool AreConnectable(FaceConnector a, FaceConnector b, int dim)
|
||||
{
|
||||
if (a.HashCode != b.HashCode) return false;
|
||||
|
||||
var av = a.Vertices;
|
||||
var bv = b.Vertices;
|
||||
for (var i = 0; i < av.Length; i++)
|
||||
{
|
||||
if (av[i] != bv[i]) return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Connect two faces.
|
||||
/// </summary>
|
||||
/// <param name="a">a.</param>
|
||||
/// <param name="b">The b.</param>
|
||||
public static void Connect(FaceConnector a, FaceConnector b)
|
||||
{
|
||||
a.Face.AdjacentFaces[a.EdgeIndex] = b.Face.Index;
|
||||
b.Face.AdjacentFaces[b.EdgeIndex] = a.Face.Index;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This internal class manages the faces of the convex hull. It is a
|
||||
/// separate class from the desired user class.
|
||||
/// </summary>
|
||||
internal sealed class ConvexFaceInternal
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the adjacent face data.
|
||||
/// </summary>
|
||||
public int[] AdjacentFaces;
|
||||
|
||||
/// <summary>
|
||||
/// The furthest vertex.
|
||||
/// </summary>
|
||||
public int FurthestVertex;
|
||||
|
||||
/// <summary>
|
||||
/// Index of the face inside the pool.
|
||||
/// </summary>
|
||||
public int Index;
|
||||
|
||||
/// <summary>
|
||||
/// Is it present in the list.
|
||||
/// </summary>
|
||||
public bool InList;
|
||||
|
||||
/// <summary>
|
||||
/// Is the normal flipped?
|
||||
/// </summary>
|
||||
public bool IsNormalFlipped;
|
||||
|
||||
/// <summary>
|
||||
/// Next node in the list.
|
||||
/// </summary>
|
||||
public ConvexFaceInternal Next;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the normal vector.
|
||||
/// </summary>
|
||||
public double[] Normal;
|
||||
|
||||
/// <summary>
|
||||
/// Face plane constant element.
|
||||
/// </summary>
|
||||
public double Offset;
|
||||
|
||||
//public int UnprocessedIndex;
|
||||
|
||||
/// <summary>
|
||||
/// Prev node in the list.
|
||||
/// </summary>
|
||||
public ConvexFaceInternal Previous;
|
||||
|
||||
/// <summary>
|
||||
/// Used to traverse affected faces and create the Delaunay representation.
|
||||
/// </summary>
|
||||
public int Tag;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the vertices.
|
||||
/// </summary>
|
||||
public int[] Vertices;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the vertices beyond.
|
||||
/// </summary>
|
||||
public IndexBuffer VerticesBeyond;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConvexFaceInternal" /> class.
|
||||
/// </summary>
|
||||
/// <param name="dimension">The dimension.</param>
|
||||
/// <param name="index">The index.</param>
|
||||
/// <param name="beyondList">The beyond list.</param>
|
||||
public ConvexFaceInternal(int dimension, int index, IndexBuffer beyondList)
|
||||
{
|
||||
Index = index;
|
||||
AdjacentFaces = new int[dimension];
|
||||
VerticesBeyond = beyondList;
|
||||
Normal = new double[dimension];
|
||||
Vertices = new int[dimension];
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue