Wjybxx.Commons.Core 1.5.0-rc2

This is a prerelease version of Wjybxx.Commons.Core.
dotnet add package Wjybxx.Commons.Core --version 1.5.0-rc2
                    
NuGet\Install-Package Wjybxx.Commons.Core -Version 1.5.0-rc2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Wjybxx.Commons.Core" Version="1.5.0-rc2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Wjybxx.Commons.Core" Version="1.5.0-rc2" />
                    
Directory.Packages.props
<PackageReference Include="Wjybxx.Commons.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Wjybxx.Commons.Core --version 1.5.0-rc2
                    
#r "nuget: Wjybxx.Commons.Core, 1.5.0-rc2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Wjybxx.Commons.Core@1.5.0-rc2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Wjybxx.Commons.Core&version=1.5.0-rc2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Wjybxx.Commons.Core&version=1.5.0-rc2&prerelease
                    
Install as a Cake Tool

Core

Core模块包含一些基础的工具类和注解,这些基础工具和注解被其它所有模块依赖。

版本号同步

注意:Wjybxx.Commons.Core,Wjybxx.Commons.Inject,Wjybxx.Commons.Concurrent 三个程序集的版本号总是保持一致,任一程序集修改,其它程序集版本号也会修改。

Collections

Core的主要内容是集合库,但凡C#的基础集合库好用一点,我也不至于自己造轮子,实现的集合类:

  1. LinkedDictionary 保持插入顺序的字典,并提供大量的有用方法。
  2. LinkedHashSet 保持插入顺序的Set,并提供大量的有用方法。
  3. IndexedPriorityQueue 含索引的优先级队列,高查询和删除效率。
  4. BoundedArrayDeque 基于数组的有界双端队列,允许手动调整容量。
  5. MultiChunkDeque 分块无界双端队列。
  6. ImmutableLinkedHastSet 保持插入序的不可变HashSet。
  7. ImmutableLinkedDictionary 保持插入序的不可变Dictionary。

LinkedDictionary特殊接口示例:


    public class LinkedDictionary<TKey,TValue> {
        TKey PeekFirstKey();
        TKey PeekLastKey();
        void AddFirst(TKey key, TValue value);
        void AddLast(TKey key, TValue value);
        KeyValuePair<TKey, TValue> RemoveFirst();
        KeyValuePair<TKey, TValue> RemoveLast();
        TValue GetAndMoveToFirst(TKey key);        
        TValue GetAndMoveToLast(TKey key);
    }
    

ReleaseNotes

1.5.0

  1. 撤销1.4.x中取消令牌的挪动,取消令牌重新挪回Concurrent包。

1.4.x

  1. LinkedDictionaryLinkedHashSet增加了MoveToAfterMoveToBefore接口。
  2. fix LinkedDictionaryLinkedHashSet中的 MoveToLastMoveToFirst实现。
  3. 开放了LinkedDictionary内部的KeyCollectionValueCollection,以避免通过Keys和Value迭代时的装箱。
  4. 重命名不可变集合,旧命名太长。
    1. ImmutableLinkedDictionaryImmutableDictionary
    2. ImmutableLinkedHashSetImmutableSet

1.4.0

  1. <s>将取消令牌相关接口挪到Core包,以支持行为树模块实现相关接口</s>

1.3.0

  1. 增加了组件模式统一接口:IEntityIComponent
  2. 修改TimeProvider的方法名

1.2.1

  1. fix LinkedHashSet和LinkedDictionary中FixPointers方法head维护错误..
  2. fix LinkedHashSet与Unity的兼容问题(IReadOnlySet)
    private void FixPointers(int source, int dest) {
        if (_count == 1) {
            _head = _tail = dest;
            return;
        }
        if (_head == source) {
            _head = dest; // 旧时将source赋值给了head...
            ref Node node = ref _table[dest];
            ref Node nextNode = ref _table[node.next];
            nextNode.prev = dest;
        } else if (_tail == source) {
            _tail = dest;
            ref Node node = ref _table[dest];
            ref Node prevNode = ref _table[node.prev];
            prevNode.next = dest;
        }
        // ...
    }

1.2.0

  1. 新增无界数组队列ArrayDeque,以方便统一Java和C#代码
  2. LinkedHashSet类型兼容ISetIReadOnlySet接口
  3. 重命名EmptyDequeueEmptyDeque
  4. 优化MultiChunkDeque的迭代器
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on Wjybxx.Commons.Core:

Package Downloads
Wjybxx.Dson

Dson-有点奇怪的配置文件格式和序列化方案

Wjybxx.Commons.Concurrent

并发基础库;提供事件循环和基于事件循环的await语法

Wjybxx.Dson.Core

Dson-有点奇怪的配置文件格式和序列化方案

Wjybxx.BTree.Core

BTree-非典型的高性能行为树实现

Wjybxx.BTree.Codec

行为树Codec包

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.0-rc2 168 6/29/2025
1.5.0-rc1 207 6/14/2025
1.4.3 183 6/4/2025
1.4.2 217 5/25/2025
1.4.1 151 5/24/2025
1.4.0 212 5/18/2025
1.3.1 289 5/14/2025
1.3.0 298 5/6/2025
1.2.1 143 11/6/2024
1.2.0 250 10/28/2024
1.1.1 567 8/25/2024
1.1.0 379 8/21/2024
1.1.0-rc3 177 7/31/2024
1.1.0-rc2 211 7/21/2024
1.1.0-rc1 214 7/14/2024
1.0.15 246 6/29/2024
1.0.14 151 5/22/2024
1.0.13 228 5/12/2024
1.0.12 210 4/11/2024
1.0.11 183 4/9/2024
1.0.10 158 4/8/2024
1.0.9 172 4/3/2024
1.0.8 173 3/18/2024
1.0.7 225 1/7/2024
1.0.6 187 1/6/2024
1.0.5 134 1/4/2024
1.0.4 184 1/2/2024
1.0.3 164 1/1/2024
1.0.2 287 12/26/2023
1.0.1 184 12/24/2023
1.0.0 217 12/23/2023
1.0.0-alpha 166 12/23/2023