![]() |
VOOZH | about |
dotnet add package War3Net.Common --version 6.0.2
NuGet\Install-Package War3Net.Common -Version 6.0.2
<PackageReference Include="War3Net.Common" Version="6.0.2" />
<PackageVersion Include="War3Net.Common" Version="6.0.2" />Directory.Packages.props
<PackageReference Include="War3Net.Common" />Project file
paket add War3Net.Common --version 6.0.2
#r "nuget: War3Net.Common, 6.0.2"
#:package War3Net.Common@6.0.2
#addin nuget:?package=War3Net.Common&version=6.0.2Install as a Cake Addin
#tool nuget:?package=War3Net.Common&version=6.0.2Install as a Cake Tool
War3Net.Common provides shared utilities for the War3Net modding library. It contains extension methods, encoding providers, and type conversion utilities commonly used when working with Warcraft III binary file formats.
BinaryReader and BinaryWriter to handle Warcraft III-specific data typesWarcraft III uses 4-character "rawcodes" to identify units, abilities, and other objects. These are stored as 32-bit integers in binary files.
using War3Net.Common.Extensions;
// Convert a rawcode string to integer
int unitId = "hpea".FromRawcode(); // Human Peasant
// Convert an integer back to rawcode string
string rawcode = unitId.ToRawcode(); // "hpea"
using System.IO;
using War3Net.Common.Extensions;
using var reader = new BinaryReader(stream);
// Read a null-terminated UTF-8 string
string name = reader.ReadChars();
// Read a fixed-length string
string fixedString = reader.ReadString(32);
// Read a 32-bit boolean (0 or 1)
bool enabled = reader.ReadBool();
// Read color values
Color rgbaColor = reader.ReadColorRgba();
Color bgraColor = reader.ReadColorBgra();
// Read typed enum values
MyEnum value = reader.ReadInt32<MyEnum>();
using War3Net.Common;
// Convert raw binary values to enums with validation
var myEnum = EnumConvert<MyEnum>.FromInt32(value);
// Use raw conversion when validation is not needed
var rawEnum = EnumConvert<MyEnum>.FromInt32Raw(value);
using War3Net.Common.Providers;
// Lenient encoding (does not throw on invalid bytes)
Encoding utf8 = UTF8EncodingProvider.UTF8;
// Strict encoding (throws on invalid bytes)
Encoding strictUtf8 = UTF8EncodingProvider.StrictUTF8;
The main types provided by this library are:
War3Net.Common.EnumConvert<TEnum> - Type-safe conversion from primitive types to enums with validationWar3Net.Common.Extensions.BinaryReaderExtensions - Extension methods for reading Warcraft III data typesWar3Net.Common.Extensions.BinaryWriterExtensions - Extension methods for writing Warcraft III data typesWar3Net.Common.Extensions.StreamExtensions - Extension methods for stream operationsWar3Net.Common.Extensions.Int32Extensions - Rawcode and color conversion from integersWar3Net.Common.Extensions.StringExtensions - Rawcode conversion from stringsWar3Net.Common.Providers.UTF8EncodingProvider - Pre-configured UTF-8 encodingsWar3Net.Common is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
This README was generated with the assistance of AI and may contain inaccuracies. Please verify the information and consult the source code for authoritative details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 4 NuGet packages that depend on War3Net.Common:
| Package | Downloads |
|---|---|
|
War3Net.CodeAnalysis.Jass
Parse and render JASS source files. |
|
|
War3Net.IO.Compression
Compression algorithms for MPQ archives. |
|
|
War3Net.IO.Slk
Read and write SLK data files. |
|
|
War3Net.Drawing.Blp
Read and write BLP texture files. |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 6.0.2 | 563 | 3/1/2026 |
| 6.0.1 | 538 | 2/1/2026 |
| 6.0.0 | 454 | 1/25/2026 |
| 5.8.0 | 3,312 | 9/6/2025 |
| 5.6.1 | 8,754 | 1/7/2023 |
| 5.6.0 | 1,725 | 12/20/2022 |
| 5.5.5 | 3,864 | 11/13/2022 |
| 5.5.3 | 2,229 | 10/29/2022 |
| 5.5.2 | 2,096 | 10/25/2022 |
| 5.5.0 | 3,211 | 8/20/2022 |
| 5.4.5 | 2,480 | 5/27/2022 |
| 5.4.0 | 5,962 | 2/13/2022 |
| 5.0.2 | 5,935 | 2/14/2021 |
| 5.0.1 | 1,649 | 12/25/2020 |
| 5.0.0 | 1,801 | 12/14/2020 |
| 0.3.2 | 2,405 | 11/11/2020 |
| 0.3.1 | 1,028 | 10/29/2020 |
| 0.3.0 | 1,666 | 10/27/2020 |
| 0.2.0 | 1,602 | 9/14/2020 |
| 0.1.3 | 2,425 | 6/21/2020 |