├── .github └── workflows │ └── dotnet.yml ├── .gitignore ├── LICENSE ├── README.md ├── README_CN.md ├── package.json └── src ├── NumericSystem.sln └── NumericSystem ├── AdditionNumericModifier.cs ├── CustomNumericModifier.cs ├── FixedPoint.cs ├── FractionNumericModifier.cs ├── FractionType.cs ├── IApply.cs ├── IInfo.cs ├── INumericModifier.cs ├── Numeric.cs ├── NumericModifierConfig.cs ├── NumericModifierInfo.cs ├── NumericSystem.csproj ├── bin ├── Debug │ └── netstandard2.1 │ │ ├── NumericSystem.deps.json │ │ ├── NumericSystem.dll │ │ └── NumericSystem.pdb └── Release │ └── netstandard2.1 │ ├── NumericSystem.deps.json │ ├── NumericSystem.dll │ ├── NumericSystem.pdb │ └── publish │ ├── NumericSystem.deps.json │ ├── NumericSystem.dll │ └── NumericSystem.pdb └── obj ├── Debug └── netstandard2.1 │ ├── .NETStandard,Version=v2.1.AssemblyAttributes.cs │ ├── NumericSystem.AssemblyInfo.cs │ ├── NumericSystem.AssemblyInfoInputs.cache │ ├── NumericSystem.GeneratedMSBuildEditorConfig.editorconfig │ ├── NumericSystem.assets.cache │ ├── NumericSystem.csproj.CoreCompileInputs.cache │ ├── NumericSystem.csproj.FileListAbsolute.txt │ ├── NumericSystem.dll │ ├── NumericSystem.pdb │ └── NumericSystem.sourcelink.json ├── NumericSystem.csproj.nuget.dgspec.json ├── NumericSystem.csproj.nuget.g.props ├── NumericSystem.csproj.nuget.g.targets ├── Release └── netstandard2.1 │ ├── .NETStandard,Version=v2.1.AssemblyAttributes.cs │ ├── NumericSystem.AssemblyInfo.cs │ ├── NumericSystem.AssemblyInfoInputs.cache │ ├── NumericSystem.GeneratedMSBuildEditorConfig.editorconfig │ ├── NumericSystem.assets.cache │ ├── NumericSystem.csproj.CoreCompileInputs.cache │ ├── NumericSystem.csproj.FileListAbsolute.txt │ ├── NumericSystem.dll │ ├── NumericSystem.pdb │ ├── NumericSystem.sourcelink.json │ └── PublishOutputs.5191e61652.txt ├── project.assets.json ├── project.nuget.cache ├── project.packagespec.json ├── rider.project.model.nuget.info └── rider.project.restore.info /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | name: .NET 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout code 15 | uses: actions/checkout@v4 16 | 17 | - name: Setup .NET 18 | uses: actions/setup-dotnet@v4 19 | with: 20 | dotnet-version: "9.0.x" 21 | 22 | - name: Restore dependencies 23 | run: dotnet restore src/NumericSystem.sln # 使用 .sln 文件进行还原 24 | 25 | - name: Build project 26 | run: dotnet build src/NumericSystem.sln --no-restore --configuration Release # 使用 .sln 文件构建 27 | 28 | - name: Run tests 29 | run: dotnet test src/NumericSystem.sln --no-build --verbosity normal --configuration Release # 使用 .sln 文件运行测试 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | /src/NumericSystem/.idea 3 | /src/NumericSystem/.idea 4 | /src/.idea 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 rdququ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | Numeric System 3 |

4 |

5 | HuaYe Studio rdququ 6 |

7 | 8 |

9 | Static Badge 10 | 11 | 12 | 13 | Static Badge 14 |

15 | 16 | ## Introduction 17 | 18 | The Numeric System is a toolset designed to address the numerical needs of gameplay, aiming to provide a simple and efficient solution for handling combat system calculations. 19 | 20 | - **Event Store-based Numeric Change Tracking:** Ensures traceability, easy self-verification, and security of original data. 21 | - **Fixed-point Arithmetic:** Guarantees numerical consistency across platforms and devices, enhancing network synchronization reliability. 22 | - **Simple Syntax:** Supports the addition of integers, floating points, fractions, or percentages to numerical values using addition, multiplication, or custom modifiers. 23 | 24 | ## Table of Contents 25 | 26 | - [Introduction](#introduction) 27 | - [Table of Contents](#table-of-contents) 28 | - [Download and Deployment](#download-and-deployment) 29 | - [Get from GitHub](#get-from-github) 30 | - [Get from npm](#get-from-npm) 31 | - [Getting Started](#getting-started) 32 | - [Creating the First Numeric](#creating-the-first-numeric) 33 | - [Attaching `AdditionNumericModifier` to Numeric](#attaching-additionnumericmodifier-to-numeric) 34 | - [Getting the Final Value of Numeric](#getting-the-final-value-of-numeric) 35 | - [Using Multiplication Modifiers(`FractionNumericModifier`)](#using-multiplication-modifiersfractionnumericmodifier) 36 | - [Modifiers' Name, Tags, and Count](#modifiers-name-tags-and-count) 37 | - [Using Tags to Partially Modify Base Values](#using-tags-to-partially-modify-base-values) 38 | - [Using Custom Modifiers](#using-custom-modifiers) 39 | - [File Path Description](#file-path-description) 40 | - [Author](#author) 41 | - [License](#license) 42 | 43 | ## Download and Deployment 44 | 45 | ### Get from GitHub 46 | 47 | ```shell 48 | git clone git@github.com:dlqw/NumericSystem.git 49 | 50 | ``` 51 | 52 | ### Get from npm 53 | 54 | ```shell 55 | npm i numericsystem 56 | ``` 57 | 58 | ## Getting Started 59 | 60 | ### Creating the First Numeric 61 | 62 | To use the tool, you need to reference `WFramework.CoreGameDevKit.NumericSystem;` 63 | 64 | ```csharp 65 | using WFramework.CoreGameDevKit.NumericSystem; 66 | ``` 67 | 68 | You can manually create a Numeric object and pass an integer or floating point number to its constructor. 69 | 70 | ```csharp 71 | Numeric health = new Numeric(100); 72 | ``` 73 | 74 | This value (100 in the example above) acts as the base value of the Numeric object and is read-only. You can retrieve its value using GetOriginValue(). To change this base value, create a new Numeric object. 75 | 76 | ```csharp 77 | // Get original/base value 78 | var healthBasicValue = health.GetOriginValue(); 79 | 80 | // Change the base value => Create a new Numeric object 81 | health = new Numeric(200); 82 | ``` 83 | 84 | Alternatively, you can assign an integer or floating-point number to a Numeric object to create a new one. 85 | 86 | ```csharp 87 | Numeric health = 100; 88 | Debug.Log(health.GetHashCode()); // 402183648 89 | 90 | health = 100.67f; 91 | Debug.Log(health.GetHashCode()); // 1146914344 92 | ``` 93 | 94 | Note that in this case, health now points to a newly allocated Numeric object. 95 | 96 | ### Attaching `AdditionNumericModifier` to Numeric 97 | 98 | You can manually create an addition modifier using `AdditionNumericModifier`. The internal value of the modifier is immutable and can be accessed through `StoreValue`. 99 | 100 | ```csharp 101 | AdditionNumericModifier strongBuff = new AdditionNumericModifier(20); 102 | var buffValue = strongBuff.StoreValue; 103 | ``` 104 | 105 | Alternatively, you can quickly create it using integers or floating-point numbers. 106 | 107 | ```csharp 108 | AdditionNumericModifier strongBuff = 20f; 109 | ``` 110 | 111 | To attach a `NumericModifier` to a Numeric object, use the `AddModifier` method or the addition operator. The following examples illustrate valid usage: 112 | 113 | ```csharp 114 | // Success 115 | health.AddModifier(strongBuff); 116 | health = health + 20; 117 | health += 20; 118 | health = health + strongBuff; 119 | health += strongBuff; 120 | 121 | // Error 122 | health.AddModifier(20); 123 | ``` 124 | 125 | Removing a modifier follows similar syntax, using the `RemoveModifier` method or the subtraction operator. 126 | 127 | **Important**: Avoid mixing these two: 128 | 129 | ```csharp 130 | health += -20; 131 | health -= 20; 132 | ``` 133 | 134 | The first example attaches a modifier with a value of -20, while the second removes a modifier with a value of 20. 135 | 136 | **Important**: Do not attach the same modifier multiple times without removing it first. You can use overloaded addition and subtraction operators to create temporary modifier objects. 137 | 138 | **Important**: Avoid mixing integers and floating-point numbers in the same Numeric object. The Numeric System is designed to work with either `int -> int` or `float -> float`, depending on your needs. 139 | 140 | ### Getting the Final Value of Numeric 141 | 142 | You can obtain the final value by calling `FinalValue` or `FinalValueF`, which return the result as an integer or floating-point number, respectively. 143 | 144 | ```csharp 145 | Numeric health = 100; 146 | 147 | health += 20.3f; 148 | 149 | Debug.Log(health.FinalValue); 150 | Debug.Log(health.FinalValueF); 151 | ``` 152 | 153 | ### Using Multiplication Modifiers(`FractionNumericModifier`) 154 | 155 | Multiplication modifiers are slightly more complex, but you can still construct, attach, or remove them in a similar way. 156 | 157 | ```csharp 158 | health.AddModifier(new FractionNumericModifier(1, 2, FractionNumericModifier.FractionType.Increase)); 159 | health *= (200, FractionNumericModifier.FractionType.Override); 160 | 161 | health.RemoveModifier(new FractionNumericModifier(1, 2, FractionNumericModifier.FractionType.Increase)); 162 | health /= (200, FractionNumericModifier.FractionType.Override); 163 | ``` 164 | 165 | You can build multiplication modifiers using (`numerator:int`, `denominator:int`, `type:FractionNumericModifier.FractionType`). You can either directly create the object or use C# tuple syntax, which offers clarity or convenience, depending on your preference. 166 | 167 | Here are two types of multiplication modifiers: 168 | 169 | ```csharp 170 | public enum FractionType 171 | { 172 | Override, // Replace the original value 173 | Increase, // Increment based on the original value 174 | } 175 | ``` 176 | 177 | An increment modifier will add a new value to the original, while a replace modifier directly sets the new value. For example, if the original value is 100 and the increment modifier is `2/1`, the result will be 300, whereas the replace modifier will yield 200. 178 | 179 | The formulas are as follows: 180 | 181 | $ Increase = (1 + (\frac{numerator}{denominator})) \times Input $ 182 | $ Override = (\frac{numerator}{denominator}) \times Input$ 183 | 184 | ### Modifiers' Name, Tags, and Count 185 | 186 | All modifiers have overloaded constructors that include `Name:string`, `Tags:string[]`, and `Count:int`. The `Name` serves as a unique identifier. If you attach a modifier with the same `Name`, it will accumulate its Count and replace the previous one. 187 | 188 | Anonymous modifiers are named "DEFAULT MODIFIER." 189 | 190 | The purpose of `Tags` will be detailed in the [next section](#using-tags-to-partially-modify-base-values). 191 | 192 | `Count` is an internal counter for stacking modifiers. 193 | 194 | ### Using Tags to Partially Modify Base Values 195 | 196 | Tags apply to addition modifiers, multiplication modifiers, and the base value of a Numeric object. Addition modifiers with specific Tags indicate which multiplication modifiers will affect them. Similarly, Numeric base values have a default tag of "SELF". 197 | 198 | Multiplication modifiers' Tags define which addition modifiers or base values they will affect. 199 | 200 | ```csharp 201 | Numeric health = 100; 202 | 203 | health += (20, new[] { "Equipment" }, "Armor", 1); 204 | Debug.Log(health.FinalValue); // 120 205 | health *= (120, FractionType.Override, new[] { "Equipment" }, "Armor Upgrade", 1); 206 | Debug.Log(health.FinalValue); // 124 207 | health *= (50, FractionType.Increase, new[] { NumericModifierConfig.TagSelf }, "Upgrade", 1); 208 | Debug.Log(health.FinalValue); // 174 209 | ``` 210 | 211 | ### Using Custom Modifiers 212 | 213 | Custom modifiers are invoked at the end of the calculation pipeline and can enforce specific constraints. For example, to limit a player's health, you can create a `Func` or `Func` that takes the target value as input and returns the constrained result. 214 | 215 | ```csharp 216 | Numeric health = 100; 217 | 218 | Func healthLimit = value => Mathf.Clamp(value, 0, 150); 219 | 220 | health.AddModifier(new CustomNumericModifier(healthLimit)); 221 | health -= healthLimit; 222 | health += new CustomNumericModifier(healthLimit); 223 | ``` 224 | 225 | In this example, the player's health is constrained between 0 and 150. The creation and attachment of `CustomNumericModifier` are similar to other modifiers, including implicit type conversions and operator overloads (`+`, `-`). 226 | 227 | Important: Do not attach conflicting conditions to the same `Numeric` object, as the final outcome may be undefined. 228 | 229 | ## File Path Description 230 | 231 | ```shell 232 | NumericSystem 233 | ├── .gitignore 234 | ├── README.md 235 | ├── package.json 236 | ├── src 237 | │ └── NumericSystem 238 | │ ├── FixedPoint.cs 239 | │ ├── Numeric.cs 240 | │ └── NumericModifier.cs 241 | └── LICENSE 242 | ``` 243 | 244 | ## Author 245 | 246 | [rdququ](https://github.com/dlqw) 247 | 248 | ## License 249 | 250 | This project is released under the [MIT License](./LICENSE) 251 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | # Numeric System 中文文档 2 | 3 | ## 简介 4 | 5 | Numeric System 是一个用于处理 gameplay 数值需求的工具集,旨在为战斗系统的数值结算提供简单、高效的解决方案。 6 | 7 | - 基于 Event Store 的数值变更记录,可溯源,易自校验,保障原始数据安全。 8 | - 使用定点数运算来确保多平台和设备间的数值一致性,并提高网络同步的可靠性。 9 | - 语法简单,支持使用整数,浮点数,分数或百分数为数值添加加法,乘法或自定义修饰。 10 | 11 | ## 目录 12 | 13 | - [Numeric System 中文文档](#numeric-system-中文文档) 14 | - [简介](#简介) 15 | - [目录](#目录) 16 | - [下载和部署](#下载和部署) 17 | - [从 github 获取](#从-github-获取) 18 | - [从 npm 获取](#从-npm-获取) 19 | - [上手指南](#上手指南) 20 | - [创建第一个 Numeric](#创建第一个-numeric) 21 | - [使用加法修正器(`AdditionNumericModifier`)为 Numeric 附加修正](#使用加法修正器additionnumericmodifier为-numeric-附加修正) 22 | - [获得 Numeric 的最终值](#获得-numeric-的最终值) 23 | - [使用乘法修正器(`FractionNumericModifier`)为 Numeric 附加修正](#使用乘法修正器fractionnumericmodifier为-numeric-附加修正) 24 | - [修正器的 Name, Tags 和 Count](#修正器的-name-tags-和-count) 25 | - [使用 Tag 部分修饰加法修正器/Numeric 基准值](#使用-tag-部分修饰加法修正器numeric-基准值) 26 | - [使用自定义修正器(`CustomNumericModifier`)为 Numeric 附加修正](#使用自定义修正器customnumericmodifier为-numeric-附加修正) 27 | - [文件路径说明](#文件路径说明) 28 | - [作者](#作者) 29 | - [版权说明](#版权说明) 30 | 31 | ## 下载和部署 32 | 33 | ### 从 github 获取 34 | 35 | ```shell 36 | git clone git@github.com:dlqw/NumericSystem.git 37 | ``` 38 | 39 | ### 从 npm 获取 40 | 41 | ```shell 42 | npm i numericsystem 43 | ``` 44 | 45 | ## 上手指南 46 | 47 | ### 创建第一个 Numeric 48 | 49 | 使用工具需要引用 `WFramework.CoreGameDevKit.NumericSystem;` 50 | 51 | ```csharp 52 | using WFramework.CoreGameDevKit.NumericSystem; 53 | ``` 54 | 55 | 您可以手动创建一个 Numeric 对象,并在其构造时传入一个整数或者浮点数。 56 | 57 | ```csharp 58 | Numeric health = new Numeric(100); 59 | ``` 60 | 61 | 这个值(上个代码段中的“100”)会作为 Numeric 的基准值,并只可读。您可以通过 `GetOriginValue()` 获取其值。如果您希望更改这个值,可以重新创建一个新的 Numeric 对象。 62 | 63 | ```csharp 64 | // 获取原始值/基准值 65 | var healthBasicValue = health.GetOriginValue(); 66 | 67 | // 希望改变基准值 => 重新创建一个新的 Numeric 对象 68 | health = new Numeric(200); 69 | ``` 70 | 71 | 您也可以向一个 Numeric 类型的对象赋一个整数或者浮点数以创建新的 Numeric 对象。 72 | 73 | ```csharp 74 | Numeric health = 100; 75 | Debug.Log(health.GetHashCode()); // 402183648 76 | 77 | health = 100.67f; 78 | Debug.Log(health.GetHashCode()); // 1146914344 79 | ``` 80 | 81 | 应当注意到,health 指向了一个新开辟的 Numeric 对象。 82 | 83 | ### 使用加法修正器(`AdditionNumericModifier`)为 Numeric 附加修正 84 | 85 | 您可以手动创建一个加法修正器 `AdditionNumericModifier`, 修正器内部的值同样是不可修改的。您可以访问 `StoreValue` 以获悉。 86 | 87 | ```csharp 88 | AdditionNumericModifier strongBuff = new AdditionNumericModifier(20); 89 | var buffValue = strongBuff.StoreValue; 90 | ``` 91 | 92 | 也可以使用整数或浮点数快速创建。 93 | 94 | ```csharp 95 | AdditionNumericModifier strongBuff = 20f; 96 | ``` 97 | 98 | 数值修正器(`NumericModifier`), 可以通过 `AddModifier` 方法附加进 Numeric 对象中。也可以通过加法运算符附加。请注意下列示例。 99 | 100 | ```csharp 101 | // Success 102 | health.AddModifier(strongBuff); 103 | health = health + 20; 104 | health += 20; 105 | health = health + strongBuff; 106 | health += strongBuff; 107 | 108 | // Error 109 | health.AddModifier(20); 110 | ``` 111 | 112 | 修正器移除的语法类似于附加,可以使用 `RemoveModifier` 方法或减法运算符。 113 | 114 | **需要注意的其一**,请勿混用 115 | 116 | ```csharp 117 | health += -20; 118 | health -= 20; 119 | ``` 120 | 121 | 前者的意思是为 health 附加一个值为 -20 的修正器,后者的意思为为 health 移除一个值为 20 的修正器。 122 | 123 | **需要注意的其二**,请勿将同一个修正器在未移除的情况下多次附加进同一个 Numeric 对象。可以使用重载的加法减法运算符创建临时修正器对象。 124 | 125 | **需要注意的其三**,请勿在同一 Numeric 中混用整数和浮点数,对于某一类型的需求,Numeric System 被设计为 `int -> int` or `float -> float`。 126 | 127 | ### 获得 Numeric 的最终值 128 | 129 | 您可以通过调用 `FinalValue` 和 `FinalValueF` 分别获取整数或浮点数的结果。 130 | 131 | ```csharp 132 | Numeric health = 100; 133 | 134 | health += 20.3f; 135 | 136 | Debug.Log(health.FinalValue); 137 | Debug.Log(health.FinalValueF); 138 | ``` 139 | 140 | ### 使用乘法修正器(`FractionNumericModifier`)为 Numeric 附加修正 141 | 142 | 乘法修正器的使用相对复杂,但您仍可以通过类似的方法去构造他,并附加或移除。 143 | 144 | ```csharp 145 | health.AddModifier(new FractionNumericModifier(1, 2, FractionNumericModifier.FractionType.Increase)); 146 | health *= (200, FractionNumericModifier.FractionType.Override); 147 | 148 | health.RemoveModifier(new FractionNumericModifier(1, 2, FractionNumericModifier.FractionType.Increase)); 149 | health /= (200, FractionNumericModifier.FractionType.Override); 150 | ``` 151 | 152 | 您可以使用 `(分子:Int,分母:Int,乘法类型:FractionNumericModifier.FractionType)来` 构建乘法修正器,直接创建对象或者使用 csharp 的元组语法都是不错的原则,前者更加清晰,后者更加方便。 153 | 154 | 下面为您介绍两种乘法修正器 155 | 156 | ```csharp 157 | public enum FractionType 158 | { 159 | Override, // 覆盖 160 | Increase, // 增量 161 | } 162 | ``` 163 | 164 | 增量修正器会在原有的基础上额外附加新的值,如原本的值为 100,乘法修正器为分子 2,分母 1,那么最终 z 增量的结果就是 300。而覆盖修正器的结果为 200。 165 | 166 | 公式如下: 167 | 168 | $ Increase = (1 + (\frac{numerator}{denominator})) \times Input $ 169 | $ Override = (\frac{numerator}{denominator}) \times Input $ 170 | 171 | 在乘法段最开头的程序演示中,我还使用了一个 `(Int,FractionType)` 的元组。其中 Int 代表的是百分比(Precent)。即为 $Precent = \frac{numerator}{100}$ 172 | 173 | ### 修正器的 Name, Tags 和 Count 174 | 175 | 无论是何种修正器,在其初始化时都有重载包含 (`Name:string`, `Tags:string[]`, `Count:int`) 176 | 其中 `Name` 时修正器的唯一身份码,`Name` 相同的修正器被视为同一个修正器,在附加进 Numeric 时后者会在 `Count` 被累加进已经存在的同名修正器后被抛弃。 177 | 178 | 匿名修正器会被命名为 "DEFAULT MODIFIER"。 179 | 180 | `Tags` 的作用在[后文](#使用-tag-部分修饰加法修正器numeric-基准值)中会详细介绍。 181 | 182 | `Count` 是修正器内部处理叠加的计数器。 183 | 184 | ### 使用 Tag 部分修饰加法修正器/Numeric 基准值 185 | 186 | Tag 只对加法修正器,乘法修正器和 Numeric 的基准值有意义。 187 | 加法修正器内的 Tags 的含义为会被哪些乘法修正器所修饰。 188 | Numeric 同理,其 Tag 默认为也仅为 "SELF"。 189 | 乘法修正器的 Tags 表明其会对哪些加法修正器 or Numeric 起作用。 190 | 191 | ```csharp 192 | Numeric health = 100; 193 | 194 | health += (20, new[] { "装备" }, "明光铠", 1); 195 | Debug.Log(health.FinalValue); // 120 196 | health *= (120, FractionType.Override, new[] { "装备" }, "明光铠升级", 1); 197 | Debug.Log(health.FinalValue); // 124 198 | health *= (50, FractionType.Increase, new[] { NumericModifierConfig.TagSelf }, "升级", 1); 199 | Debug.Log(health.FinalValue); // 174 200 | ``` 201 | 202 | ### 使用自定义修正器(`CustomNumericModifier`)为 Numeric 附加修正 203 | 204 | 约束修正器在结算管线的末端被调用,他可以帮助您对某项数值进行特定的约束。以约束玩家的生命值为例。您可以创建一个 `Func` 或 `Func`,其传入值为目标数值的输入,输出为在您约束后的结果。如下: 205 | 206 | ```csharp 207 | Numeric health = 100; 208 | 209 | Func healthLimit = value => Mathf.Clamp(value, 0, 150); 210 | 211 | health.AddModifier(new CustomNumericModifier(healthLimit)); 212 | health -= healthLimit; 213 | health += new CustomNumericModifier(healthLimit); 214 | ``` 215 | 216 | 最终,玩家的生命值被约束在了 0 到 150 之间。自定义修正器(`CustomNumericModifier`)的创建与附加同之前的修正器大同小异,包括隐式类型转换和运算符重载 (`+`, `-`),不再过多赘述。 217 | 218 | 如果您为一个 `Numeric` 对象同时附加了相斥的条件,最终执行结果是未定义的,请不要这么做。 219 | 220 | ## 文件路径说明 221 | 222 | ```shell 223 | NumericSystem 224 | ├── .gitignore 225 | ├── README.md 226 | ├── package.json 227 | ├── src 228 | │ └── NumericSystem 229 | │ ├── FixedPoint.cs 230 | │ ├── Numeric.cs 231 | │ └── NumericModifier.cs 232 | └── LICENSE 233 | ``` 234 | 235 | ## 作者 236 | 237 | [rdququ](https://github.com/dlqw) 238 | 239 | ## 版权说明 240 | 241 | 项目基于 [MIT License](./LICENSE) 发布 242 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "numericsystem", 3 | "version": "2.0.0", 4 | "description": "A flexible, generalized numerical system for computing game values.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/dlqw/NumericSystem.git" 12 | }, 13 | "author": "rdququ", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/dlqw/NumericSystem/issues" 17 | }, 18 | "homepage": "https://github.com/dlqw/NumericSystem#readme" 19 | } 20 | -------------------------------------------------------------------------------- /src/NumericSystem.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NumericSystem", "NumericSystem\NumericSystem.csproj", "{5E89E637-0216-4D48-98B8-3256A4839821}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | Release|Any CPU = Release|Any CPU 9 | EndGlobalSection 10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 | {5E89E637-0216-4D48-98B8-3256A4839821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 | {5E89E637-0216-4D48-98B8-3256A4839821}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 | {5E89E637-0216-4D48-98B8-3256A4839821}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 | {5E89E637-0216-4D48-98B8-3256A4839821}.Release|Any CPU.Build.0 = Release|Any CPU 15 | EndGlobalSection 16 | EndGlobal 17 | -------------------------------------------------------------------------------- /src/NumericSystem/AdditionNumericModifier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using static WFramework.CoreGameDevKit.NumericSystem.NumericModifierConfig; 3 | 4 | namespace WFramework.CoreGameDevKit.NumericSystem 5 | { 6 | public sealed class AdditionNumericModifier : INumericModifier 7 | { 8 | public readonly int StoreValue; 9 | 10 | ModifierType INumericModifier.Type => ModifierType.Add; 11 | 12 | public NumericModifierInfo Info { get; } 13 | 14 | public Func Apply(int source) { return _ => source + StoreValue * Info.Count; } 15 | 16 | #region 构造函数和隐式转换 17 | 18 | public AdditionNumericModifier(int value) 19 | { 20 | StoreValue = value; 21 | Info = DefaultInfo; 22 | } 23 | 24 | public AdditionNumericModifier(float value) 25 | { 26 | StoreValue = value.ToFixedPoint(); 27 | Info = DefaultInfo; 28 | } 29 | 30 | public AdditionNumericModifier(int value, string[] tags, string name, int count = 1) 31 | { 32 | StoreValue = value; 33 | Info = new NumericModifierInfo(tags, name, count); 34 | } 35 | 36 | public AdditionNumericModifier(float value, string[] tags, string name, int count = 1) 37 | { 38 | StoreValue = value.ToFixedPoint(); 39 | Info = new NumericModifierInfo(tags, name, count); 40 | } 41 | 42 | public static implicit operator AdditionNumericModifier(int value) => new(value); 43 | 44 | public static implicit operator AdditionNumericModifier(float value) => new(value); 45 | 46 | public static implicit operator AdditionNumericModifier((int value, string[] tags, string name, int count) tuple) 47 | => new(tuple.value, tuple.tags, tuple.name, tuple.count); 48 | 49 | public static implicit operator AdditionNumericModifier((float value, string[] tags, string name, int count) tuple) 50 | => new(tuple.value, tuple.tags, tuple.name, tuple.count); 51 | 52 | #endregion 53 | } 54 | } -------------------------------------------------------------------------------- /src/NumericSystem/CustomNumericModifier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WFramework.CoreGameDevKit.NumericSystem 4 | { 5 | public sealed class CustomNumericModifier : INumericModifier 6 | { 7 | ModifierType INumericModifier.Type => ModifierType.Custom; 8 | public NumericModifierInfo Info { get; } 9 | 10 | private readonly Func intFunc; 11 | private readonly Func floatFunc; 12 | 13 | 14 | public CustomNumericModifier(Func intFunc) 15 | { 16 | this.intFunc = intFunc; 17 | Info = NumericModifierConfig.DefaultInfo; 18 | } 19 | 20 | public CustomNumericModifier(Func floatFunc) 21 | { 22 | this.floatFunc = floatFunc; 23 | Info = NumericModifierConfig.DefaultInfo; 24 | } 25 | 26 | public CustomNumericModifier(Func intFunc, string[] tags, string name, int count = 1) 27 | { 28 | this.intFunc = intFunc; 29 | Info = new NumericModifierInfo(tags, name, count); 30 | } 31 | 32 | public CustomNumericModifier(Func floatFunc, string[] tags, string name, int count = 1) 33 | { 34 | this.floatFunc = floatFunc; 35 | Info = new NumericModifierInfo(tags, name, count); 36 | } 37 | 38 | public static implicit operator CustomNumericModifier(Func intFunc) => new(intFunc); 39 | public static implicit operator CustomNumericModifier(Func floatFunc) => new(floatFunc); 40 | 41 | public static implicit operator CustomNumericModifier((Func intFunc, string[] tags, string name, int count) tuple) 42 | => new(tuple.intFunc, tuple.tags, tuple.name, tuple.count); 43 | 44 | public static implicit operator CustomNumericModifier((Func floatFunc, string[] tags, string name, int count) tuple) 45 | => new(tuple.floatFunc, tuple.tags, tuple.name, tuple.count); 46 | 47 | public Func Apply(int source) 48 | { 49 | return _ => intFunc?.Invoke(source) 50 | ?? floatFunc.Invoke(source.ToFloat()) 51 | .ToFixedPoint(); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /src/NumericSystem/FixedPoint.cs: -------------------------------------------------------------------------------- 1 | namespace WFramework.CoreGameDevKit.NumericSystem 2 | { 3 | public static class FixedPoint 4 | { 5 | public const uint Factor = 10000; 6 | public static int ToFixedPoint(this float value) { return (int)(value * Factor); } 7 | public static int ToFixedPoint(this int value) { return (int)(value * Factor); } 8 | public static float ToFloat(this int value) { return value / (float)Factor; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/NumericSystem/FractionNumericModifier.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | 4 | namespace WFramework.CoreGameDevKit.NumericSystem 5 | { 6 | public sealed class FractionNumericModifier : INumericModifier 7 | { 8 | private readonly int numerator; // 分子 9 | private readonly int denominator; // 分母 10 | 11 | private readonly FractionType type; 12 | public NumericModifierInfo Info { get; } 13 | ModifierType INumericModifier. Type => ModifierType.Frac; 14 | 15 | #region 构造函数和隐式转换 16 | 17 | public FractionNumericModifier(int numerator, int denominator, FractionType type) 18 | { 19 | this.numerator = numerator; 20 | this.denominator = denominator; 21 | this.type = type; 22 | Info = NumericModifierConfig.DefaultInfo; 23 | } 24 | 25 | public FractionNumericModifier(int precent, FractionType type) : this(precent, 100, type) { } 26 | 27 | public FractionNumericModifier( 28 | int numerator, 29 | int denominator, 30 | FractionType type, 31 | string[] tags, 32 | string name, 33 | int count = 1) 34 | { 35 | this.numerator = numerator; 36 | this.denominator = denominator; 37 | this.type = type; 38 | Info = new NumericModifierInfo(tags, name, count); 39 | } 40 | 41 | public FractionNumericModifier(int precent, FractionType type, string[] tags, string name, int count = 1) : this 42 | (precent, 100, type, tags, name, count) 43 | { 44 | } 45 | 46 | public static implicit operator FractionNumericModifier((int numerator, int denominator, FractionType type) tuple) 47 | => new(tuple.numerator, tuple.denominator, tuple.type); 48 | 49 | public static implicit operator FractionNumericModifier( 50 | (int numerator, int denominator, FractionType type, string[] tags, string name, int count) tuple) 51 | => new(tuple.numerator, tuple.denominator, tuple.type, tuple.tags, tuple.name, tuple.count); 52 | 53 | public static implicit operator FractionNumericModifier((int precent, FractionType type) tuple) 54 | => new(tuple.precent, tuple.type); 55 | 56 | public static implicit operator FractionNumericModifier((int precent, FractionType type, string[] tags, string name, int count) tuple) 57 | => new(tuple.precent, tuple.type, tuple.tags, tuple.name, tuple.count); 58 | 59 | #endregion 60 | 61 | public Func Apply(int source) => numeric => 62 | { 63 | var allAddModifierValue = numeric.GetAddModifierValue(); 64 | var targetAddModifierValue = numeric.GetAddModifierValueByTag(Info.Tags); 65 | var noTargetAddModiferValue = allAddModifierValue - targetAddModifierValue; 66 | return type switch 67 | { 68 | FractionType.Increase => GetIncrease(targetAddModifierValue) + noTargetAddModiferValue + GetOrigin(GetIncrease) + GetOtherFrac(), 69 | FractionType.Override => GetOverride(targetAddModifierValue) + noTargetAddModiferValue + GetOrigin(GetOverride) + GetOtherFrac(), 70 | _ => throw new ArgumentOutOfRangeException() 71 | }; 72 | 73 | int GetOrigin(Func func) 74 | => Info.Tags.Contains(NumericModifierConfig.TagSelf) ? func(numeric.GetOriginValue()) : numeric.GetOriginValue(); 75 | 76 | int GetOtherFrac() => source - allAddModifierValue - numeric.GetOriginValue(); 77 | }; 78 | 79 | int GetIncrease(int value) => (int)(value * (1 + numerator * Info.Count / (float)denominator)); 80 | int GetOverride(int value) => (int)(value * MathF.Pow(numerator / (float)denominator, Info.Count)); 81 | } 82 | } -------------------------------------------------------------------------------- /src/NumericSystem/FractionType.cs: -------------------------------------------------------------------------------- 1 | namespace WFramework.CoreGameDevKit.NumericSystem 2 | { 3 | public enum FractionType 4 | { 5 | Override, // 覆盖 6 | Increase, // 增量 7 | } 8 | } -------------------------------------------------------------------------------- /src/NumericSystem/IApply.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WFramework.CoreGameDevKit.NumericSystem 4 | { 5 | public interface IApply 6 | { 7 | Func Apply(int source); 8 | } 9 | } -------------------------------------------------------------------------------- /src/NumericSystem/IInfo.cs: -------------------------------------------------------------------------------- 1 | namespace WFramework.CoreGameDevKit.NumericSystem 2 | { 3 | public interface IInfo 4 | { 5 | NumericModifierInfo Info { get; } 6 | } 7 | } -------------------------------------------------------------------------------- /src/NumericSystem/INumericModifier.cs: -------------------------------------------------------------------------------- 1 | namespace WFramework.CoreGameDevKit.NumericSystem 2 | { 3 | internal enum ModifierType 4 | { 5 | None, 6 | Add, 7 | Frac, 8 | Custom 9 | } 10 | 11 | public interface INumericModifier : IInfo, IApply 12 | { 13 | internal abstract ModifierType Type { get; } 14 | } 15 | } -------------------------------------------------------------------------------- /src/NumericSystem/Numeric.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace WFramework.CoreGameDevKit.NumericSystem 6 | { 7 | [Serializable] 8 | public class Numeric 9 | { 10 | private readonly int originalValue; 11 | 12 | private int finalValue; 13 | 14 | public int FinalValue 15 | { 16 | get 17 | { 18 | Update(); 19 | return finalValue; 20 | } 21 | } 22 | 23 | public float FinalValueF 24 | { 25 | get 26 | { 27 | Update(); 28 | return finalValue.ToFloat(); 29 | } 30 | } 31 | 32 | private int lastValue; 33 | private bool hasUpdate = true; 34 | 35 | private readonly HashSet modifiers = new HashSet(); 36 | private readonly HashSet constraintModifier = new HashSet(); 37 | 38 | public int GetOriginValue() => originalValue; 39 | 40 | public int GetAddModifierValue() 41 | => modifiers.Where(mod => mod.Type == ModifierType.Add) 42 | .Sum(mod => mod.Info.Count * ((AdditionNumericModifier)mod).StoreValue); 43 | 44 | public int GetAddModifierValueByTag(string[] tags) 45 | => modifiers.Where(mod => mod.Type == ModifierType.Add) 46 | .Where(mod => mod.Info.Tags.Intersect(tags).Any()) 47 | .Sum(mod => mod.Info.Count * ((AdditionNumericModifier)mod).StoreValue); 48 | 49 | public Numeric AddModifier(INumericModifier modifier) 50 | { 51 | if (modifier is CustomNumericModifier customModifier) 52 | { 53 | constraintModifier.Add(customModifier); 54 | } 55 | else 56 | { 57 | var existModifier = modifiers.FirstOrDefault(mod => mod.Info.Name == modifier.Info.Name); 58 | if (existModifier != null) existModifier.Info.Count += modifier.Info.Count; 59 | else modifiers.Add(modifier); 60 | } 61 | 62 | hasUpdate = true; 63 | return this; 64 | } 65 | 66 | public Numeric RemoveModifier(INumericModifier modifier) 67 | { 68 | if (modifier is CustomNumericModifier customModifier) 69 | { 70 | constraintModifier.Remove(customModifier); 71 | } 72 | else 73 | { 74 | var existModifier = modifiers.FirstOrDefault(mod => mod.Info.Name == modifier.Info.Name); 75 | if (existModifier != null) 76 | { 77 | existModifier.Info.Count -= modifier.Info.Count; 78 | if (existModifier.Info.Count <= 0) modifiers.Remove(existModifier); 79 | } 80 | } 81 | 82 | hasUpdate = true; 83 | return this; 84 | } 85 | 86 | public Numeric Clear() 87 | { 88 | modifiers.Clear(); 89 | return this; 90 | } 91 | 92 | private void Update() 93 | { 94 | if (!hasUpdate) 95 | { 96 | finalValue = lastValue; 97 | return; 98 | } 99 | 100 | finalValue = originalValue; 101 | foreach (var modifier in modifiers) finalValue = modifier.Apply(finalValue)(this); 102 | 103 | foreach (var customNumericModifier in constraintModifier) finalValue = customNumericModifier.Apply(finalValue)(this); 104 | 105 | 106 | lastValue = finalValue; 107 | hasUpdate = false; 108 | } 109 | 110 | public Numeric(int value) 111 | { 112 | originalValue = value; 113 | lastValue = value; 114 | } 115 | 116 | public Numeric(float value) 117 | { 118 | originalValue = value.ToFixedPoint(); 119 | lastValue = originalValue; 120 | } 121 | 122 | public static implicit operator Numeric(int value) { return new Numeric(value); } 123 | public static implicit operator Numeric(float value) { return new Numeric(value); } 124 | public static implicit operator int(Numeric numeric) { return numeric.FinalValue; } 125 | public static implicit operator float(Numeric numeric) { return numeric.FinalValueF; } 126 | 127 | public static Numeric operator +(Numeric numeric, AdditionNumericModifier modifier) => numeric.AddModifier(modifier); 128 | 129 | public static Numeric operator -(Numeric numeric, AdditionNumericModifier modifier) => numeric.RemoveModifier(modifier); 130 | 131 | public static Numeric operator *(Numeric numeric, FractionNumericModifier modifier) => numeric.AddModifier(modifier); 132 | 133 | public static Numeric operator /(Numeric numeric, FractionNumericModifier modifier) => numeric.RemoveModifier(modifier); 134 | 135 | public static Numeric operator +(Numeric numeric, CustomNumericModifier modifier) => numeric.AddModifier(modifier); 136 | 137 | public static Numeric operator -(Numeric numeric, CustomNumericModifier modifier) => numeric.RemoveModifier(modifier); 138 | } 139 | } -------------------------------------------------------------------------------- /src/NumericSystem/NumericModifierConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WFramework.CoreGameDevKit.NumericSystem 4 | { 5 | public static class NumericModifierConfig 6 | { 7 | public const string TagSelf = "SELF"; 8 | public const string DefaultName = "DEFAULT MODIFIER"; 9 | public const int DefaultCount = 1; 10 | 11 | public static NumericModifierInfo DefaultInfo => new(Array.Empty(), DefaultName, DefaultCount); 12 | } 13 | } -------------------------------------------------------------------------------- /src/NumericSystem/NumericModifierInfo.cs: -------------------------------------------------------------------------------- 1 | namespace WFramework.CoreGameDevKit.NumericSystem 2 | { 3 | public record NumericModifierInfo 4 | { 5 | public readonly string[] Tags; 6 | public readonly string Name; 7 | 8 | public int Count; 9 | 10 | public NumericModifierInfo(string[] tags, string name, int count) 11 | { 12 | Tags = tags; 13 | Name = name; 14 | Count = count; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/NumericSystem/NumericSystem.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.1 5 | enable 6 | 9 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/NumericSystem/bin/Debug/netstandard2.1/NumericSystem.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETStandard,Version=v2.1/", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETStandard,Version=v2.1": {}, 9 | ".NETStandard,Version=v2.1/": { 10 | "NumericSystem/1.0.0": { 11 | "runtime": { 12 | "NumericSystem.dll": {} 13 | } 14 | } 15 | } 16 | }, 17 | "libraries": { 18 | "NumericSystem/1.0.0": { 19 | "type": "project", 20 | "serviceable": false, 21 | "sha512": "" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/NumericSystem/bin/Debug/netstandard2.1/NumericSystem.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/bin/Debug/netstandard2.1/NumericSystem.dll -------------------------------------------------------------------------------- /src/NumericSystem/bin/Debug/netstandard2.1/NumericSystem.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/bin/Debug/netstandard2.1/NumericSystem.pdb -------------------------------------------------------------------------------- /src/NumericSystem/bin/Release/netstandard2.1/NumericSystem.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETStandard,Version=v2.1/", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETStandard,Version=v2.1": {}, 9 | ".NETStandard,Version=v2.1/": { 10 | "NumericSystem/1.0.0": { 11 | "runtime": { 12 | "NumericSystem.dll": {} 13 | } 14 | } 15 | } 16 | }, 17 | "libraries": { 18 | "NumericSystem/1.0.0": { 19 | "type": "project", 20 | "serviceable": false, 21 | "sha512": "" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/NumericSystem/bin/Release/netstandard2.1/NumericSystem.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/bin/Release/netstandard2.1/NumericSystem.dll -------------------------------------------------------------------------------- /src/NumericSystem/bin/Release/netstandard2.1/NumericSystem.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/bin/Release/netstandard2.1/NumericSystem.pdb -------------------------------------------------------------------------------- /src/NumericSystem/bin/Release/netstandard2.1/publish/NumericSystem.deps.json: -------------------------------------------------------------------------------- 1 | { 2 | "runtimeTarget": { 3 | "name": ".NETStandard,Version=v2.1/", 4 | "signature": "" 5 | }, 6 | "compilationOptions": {}, 7 | "targets": { 8 | ".NETStandard,Version=v2.1": {}, 9 | ".NETStandard,Version=v2.1/": { 10 | "NumericSystem/1.0.0": { 11 | "runtime": { 12 | "NumericSystem.dll": {} 13 | } 14 | } 15 | } 16 | }, 17 | "libraries": { 18 | "NumericSystem/1.0.0": { 19 | "type": "project", 20 | "serviceable": false, 21 | "sha512": "" 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/NumericSystem/bin/Release/netstandard2.1/publish/NumericSystem.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/bin/Release/netstandard2.1/publish/NumericSystem.dll -------------------------------------------------------------------------------- /src/NumericSystem/bin/Release/netstandard2.1/publish/NumericSystem.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/bin/Release/netstandard2.1/publish/NumericSystem.pdb -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] 5 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | using System; 11 | using System.Reflection; 12 | 13 | [assembly: System.Reflection.AssemblyCompanyAttribute("NumericSystem")] 14 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] 15 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 16 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+ea6641dc10f91865bc20ac1e668d4550791736b0")] 17 | [assembly: System.Reflection.AssemblyProductAttribute("NumericSystem")] 18 | [assembly: System.Reflection.AssemblyTitleAttribute("NumericSystem")] 19 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 20 | 21 | // 由 MSBuild WriteCodeFragment 类生成。 22 | 23 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 9e30d3f31ddf18476b43960c79f83e9a8a9ec08155f018c19d1156183203fdf1 2 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.RootNamespace = NumericSystem 3 | build_property.ProjectDir = H:\Program\NumericSystem\src\NumericSystem\ 4 | build_property.EnableComHosting = 5 | build_property.EnableGeneratedComInterfaceComImportInterop = 6 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.assets.cache -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 056d02920e7460153e883785e1968cf4c37f5caadba78d27d2feda0aaa974376 2 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Debug\netstandard2.1\NumericSystem.deps.json 2 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Debug\netstandard2.1\NumericSystem.dll 3 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Debug\netstandard2.1\NumericSystem.pdb 4 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.GeneratedMSBuildEditorConfig.editorconfig 5 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.AssemblyInfoInputs.cache 6 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.AssemblyInfo.cs 7 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.csproj.CoreCompileInputs.cache 8 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.sourcelink.json 9 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.dll 10 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.pdb 11 | H:\Program\NumericSystem\src\NumericSystem\bin\Debug\netstandard2.1\NumericSystem.deps.json 12 | H:\Program\NumericSystem\src\NumericSystem\bin\Debug\netstandard2.1\NumericSystem.dll 13 | H:\Program\NumericSystem\src\NumericSystem\bin\Debug\netstandard2.1\NumericSystem.pdb 14 | H:\Program\NumericSystem\src\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.GeneratedMSBuildEditorConfig.editorconfig 15 | H:\Program\NumericSystem\src\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.AssemblyInfoInputs.cache 16 | H:\Program\NumericSystem\src\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.AssemblyInfo.cs 17 | H:\Program\NumericSystem\src\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.csproj.CoreCompileInputs.cache 18 | H:\Program\NumericSystem\src\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.sourcelink.json 19 | H:\Program\NumericSystem\src\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.dll 20 | H:\Program\NumericSystem\src\NumericSystem\obj\Debug\netstandard2.1\NumericSystem.pdb 21 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.dll -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.pdb -------------------------------------------------------------------------------- /src/NumericSystem/obj/Debug/netstandard2.1/NumericSystem.sourcelink.json: -------------------------------------------------------------------------------- 1 | {"documents":{"H:\\Program\\NumericSystem\\*":"https://raw.githubusercontent.com/dlqw/NumericSystem/ea6641dc10f91865bc20ac1e668d4550791736b0/*"}} -------------------------------------------------------------------------------- /src/NumericSystem/obj/NumericSystem.csproj.nuget.dgspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "format": 1, 3 | "restore": { 4 | "H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj": {} 5 | }, 6 | "projects": { 7 | "H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj": { 8 | "version": "1.0.0", 9 | "restore": { 10 | "projectUniqueName": "H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj", 11 | "projectName": "NumericSystem", 12 | "projectPath": "H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj", 13 | "packagesPath": "C:\\Users\\車部拟幻\\.nuget\\packages\\", 14 | "outputPath": "H:\\Program\\NumericSystem\\src\\NumericSystem\\obj\\", 15 | "projectStyle": "PackageReference", 16 | "fallbackFolders": [ 17 | "H:\\qxyustudy\\VS2022\\sdk\\NuGetPackages" 18 | ], 19 | "configFilePaths": [ 20 | "C:\\Users\\車部拟幻\\AppData\\Roaming\\NuGet\\NuGet.Config", 21 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", 22 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" 23 | ], 24 | "originalTargetFrameworks": [ 25 | "netstandard2.1" 26 | ], 27 | "sources": { 28 | "https://api.nuget.org/v3/index.json": {} 29 | }, 30 | "frameworks": { 31 | "netstandard2.1": { 32 | "targetAlias": "netstandard2.1", 33 | "projectReferences": {} 34 | } 35 | }, 36 | "warningProperties": { 37 | "warnAsError": [ 38 | "NU1605" 39 | ] 40 | } 41 | }, 42 | "frameworks": { 43 | "netstandard2.1": { 44 | "targetAlias": "netstandard2.1", 45 | "imports": [ 46 | "net461", 47 | "net462", 48 | "net47", 49 | "net471", 50 | "net472", 51 | "net48", 52 | "net481" 53 | ], 54 | "assetTargetFallback": true, 55 | "warn": true, 56 | "frameworkReferences": { 57 | "NETStandard.Library": { 58 | "privateAssets": "all" 59 | } 60 | }, 61 | "runtimeIdentifierGraphPath": "C:\\Users\\車部拟幻\\.dotnet\\sdk\\8.0.203\\RuntimeIdentifierGraph.json" 62 | } 63 | } 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /src/NumericSystem/obj/NumericSystem.csproj.nuget.g.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | True 5 | NuGet 6 | $(MSBuildThisFileDirectory)project.assets.json 7 | $(UserProfile)\.nuget\packages\ 8 | C:\Users\車部拟幻\.nuget\packages\;H:\qxyustudy\VS2022\sdk\NuGetPackages 9 | PackageReference 10 | 6.9.1 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/NumericSystem.csproj.nuget.g.targets: -------------------------------------------------------------------------------- 1 |  2 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/.NETStandard,Version=v2.1.AssemblyAttributes.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using System.Reflection; 4 | [assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] 5 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | using System; 11 | using System.Reflection; 12 | 13 | [assembly: System.Reflection.AssemblyCompanyAttribute("NumericSystem")] 14 | [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] 15 | [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] 16 | [assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d91972321a1a852aa778724afaf7fb3cfc6b734a")] 17 | [assembly: System.Reflection.AssemblyProductAttribute("NumericSystem")] 18 | [assembly: System.Reflection.AssemblyTitleAttribute("NumericSystem")] 19 | [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] 20 | 21 | // 由 MSBuild WriteCodeFragment 类生成。 22 | 23 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.AssemblyInfoInputs.cache: -------------------------------------------------------------------------------- 1 | 978ba65b21f27e2e077f97249469ead64a4f2e9ded2bc5c17d663bed8639d4a0 2 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.GeneratedMSBuildEditorConfig.editorconfig: -------------------------------------------------------------------------------- 1 | is_global = true 2 | build_property.RootNamespace = NumericSystem 3 | build_property.ProjectDir = H:\Program\NumericSystem\src\NumericSystem\NumericSystem\ 4 | build_property.EnableComHosting = 5 | build_property.EnableGeneratedComInterfaceComImportInterop = 6 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.assets.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.assets.cache -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 4bb16b77d49d197b53e9b57687f837ecd079d3172d5b0af595508e8e651434b2 2 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Release\netstandard2.1\NumericSystem.deps.json 2 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Release\netstandard2.1\NumericSystem.dll 3 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Release\netstandard2.1\NumericSystem.pdb 4 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Release\netstandard2.1\NumericSystem.GeneratedMSBuildEditorConfig.editorconfig 5 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Release\netstandard2.1\NumericSystem.AssemblyInfoInputs.cache 6 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Release\netstandard2.1\NumericSystem.AssemblyInfo.cs 7 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Release\netstandard2.1\NumericSystem.csproj.CoreCompileInputs.cache 8 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Release\netstandard2.1\NumericSystem.sourcelink.json 9 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Release\netstandard2.1\NumericSystem.dll 10 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\obj\Release\netstandard2.1\NumericSystem.pdb 11 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.dll -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dlqw/numerickit-wf-unity/b140c05e829ee338de9a726cf953040b78d2cdf6/src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.pdb -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/NumericSystem.sourcelink.json: -------------------------------------------------------------------------------- 1 | {"documents":{"H:\\Program\\NumericSystem\\*":"https://raw.githubusercontent.com/dlqw/NumericSystem/d91972321a1a852aa778724afaf7fb3cfc6b734a/*"}} -------------------------------------------------------------------------------- /src/NumericSystem/obj/Release/netstandard2.1/PublishOutputs.5191e61652.txt: -------------------------------------------------------------------------------- 1 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Release\netstandard2.1\publish\NumericSystem.dll 2 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Release\netstandard2.1\publish\NumericSystem.deps.json 3 | H:\Program\NumericSystem\src\NumericSystem\NumericSystem\bin\Release\netstandard2.1\publish\NumericSystem.pdb 4 | -------------------------------------------------------------------------------- /src/NumericSystem/obj/project.assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "targets": { 4 | ".NETStandard,Version=v2.1": {} 5 | }, 6 | "libraries": {}, 7 | "projectFileDependencyGroups": { 8 | ".NETStandard,Version=v2.1": [] 9 | }, 10 | "packageFolders": { 11 | "C:\\Users\\車部拟幻\\.nuget\\packages\\": {}, 12 | "H:\\qxyustudy\\VS2022\\sdk\\NuGetPackages": {} 13 | }, 14 | "project": { 15 | "version": "1.0.0", 16 | "restore": { 17 | "projectUniqueName": "H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj", 18 | "projectName": "NumericSystem", 19 | "projectPath": "H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj", 20 | "packagesPath": "C:\\Users\\車部拟幻\\.nuget\\packages\\", 21 | "outputPath": "H:\\Program\\NumericSystem\\src\\NumericSystem\\obj\\", 22 | "projectStyle": "PackageReference", 23 | "fallbackFolders": [ 24 | "H:\\qxyustudy\\VS2022\\sdk\\NuGetPackages" 25 | ], 26 | "configFilePaths": [ 27 | "C:\\Users\\車部拟幻\\AppData\\Roaming\\NuGet\\NuGet.Config", 28 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", 29 | "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" 30 | ], 31 | "originalTargetFrameworks": [ 32 | "netstandard2.1" 33 | ], 34 | "sources": { 35 | "https://api.nuget.org/v3/index.json": {} 36 | }, 37 | "frameworks": { 38 | "netstandard2.1": { 39 | "targetAlias": "netstandard2.1", 40 | "projectReferences": {} 41 | } 42 | }, 43 | "warningProperties": { 44 | "warnAsError": [ 45 | "NU1605" 46 | ] 47 | } 48 | }, 49 | "frameworks": { 50 | "netstandard2.1": { 51 | "targetAlias": "netstandard2.1", 52 | "imports": [ 53 | "net461", 54 | "net462", 55 | "net47", 56 | "net471", 57 | "net472", 58 | "net48", 59 | "net481" 60 | ], 61 | "assetTargetFallback": true, 62 | "warn": true, 63 | "frameworkReferences": { 64 | "NETStandard.Library": { 65 | "privateAssets": "all" 66 | } 67 | }, 68 | "runtimeIdentifierGraphPath": "C:\\Users\\車部拟幻\\.dotnet\\sdk\\8.0.203\\RuntimeIdentifierGraph.json" 69 | } 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /src/NumericSystem/obj/project.nuget.cache: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "dgSpecHash": "eVNs55DuYnrEI1NzJy3t+WxE3uVOnVSHciK7yIJcu6m2mCf0mJy8/ERwVOEjXgx9vtJRADHKfCXtXhlGwSOlnA==", 4 | "success": true, 5 | "projectFilePath": "H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj", 6 | "expectedPackageFiles": [], 7 | "logs": [] 8 | } -------------------------------------------------------------------------------- /src/NumericSystem/obj/project.packagespec.json: -------------------------------------------------------------------------------- 1 | "restore":{"projectUniqueName":"H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj","projectName":"NumericSystem","projectPath":"H:\\Program\\NumericSystem\\src\\NumericSystem\\NumericSystem.csproj","outputPath":"H:\\Program\\NumericSystem\\src\\NumericSystem\\obj\\","projectStyle":"PackageReference","fallbackFolders":["H:\\qxyustudy\\VS2022\\sdk\\NuGetPackages"],"originalTargetFrameworks":["netstandard2.1"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"netstandard2.1":{"targetAlias":"netstandard2.1","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]}}"frameworks":{"netstandard2.1":{"targetAlias":"netstandard2.1","imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"NETStandard.Library":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Users\\車部拟幻\\.dotnet\\sdk\\8.0.203\\RuntimeIdentifierGraph.json"}} -------------------------------------------------------------------------------- /src/NumericSystem/obj/rider.project.model.nuget.info: -------------------------------------------------------------------------------- 1 | 17246571940771918 -------------------------------------------------------------------------------- /src/NumericSystem/obj/rider.project.restore.info: -------------------------------------------------------------------------------- 1 | 17246596678861149 --------------------------------------------------------------------------------