am1goo.Storm.Net
1.0.2
See the version list below for details.
dotnet add package am1goo.Storm.Net --version 1.0.2
NuGet\Install-Package am1goo.Storm.Net -Version 1.0.2
<PackageReference Include="am1goo.Storm.Net" Version="1.0.2" />
paket add am1goo.Storm.Net --version 1.0.2
#r "nuget: am1goo.Storm.Net, 1.0.2"
// Install am1goo.Storm.Net as a Cake Addin #addin nuget:?package=am1goo.Storm.Net&version=1.0.2 // Install am1goo.Storm.Net as a Cake Tool #tool nuget:?package=am1goo.Storm.Net&version=1.0.2
Storm.Net
STORM (Strong Typed Object Referenced Model) - another way to make a deal with configuration files.
It's easy to use and give to you unlimited power to control every field or property in your file.
Why I made it?
I've worked in the video game industry at least 10 year and I've see how many errors was produced by a development team who works with JSON
config files. Each error has chance to produce bugs and our most large time-eaters - tasks in trackers!
As you know, a lot of games used JSON
format to declare game data and all of those files can be huge!
For example: GTA 5 game config has 63k items and 10mb size!
And I've decided that it could be easy to modify if it will have some tips like type definitions.
Syntax
Parameter key and his type shoud be separate by :
colon symbol.
Value should be next after =
equals sign.
- Primitive and custom types, also enums:
{param name}
:{type}
={value}
- Arrays:
{array name}
=[ .. any values between brackets .. ]
- Objects:
{object name}
={ .. any properties between braces .. }
Built-in primitive types:
b
- booleanbt
- bytesbt
- signed bytes
- short (int16)us
- unsigned short (uint16)i
- integer (int32)ui
- unsigned integer (uint32)l
- long (int64)ul
- unsigned long (uint64)f
- single aka floatd
- doubledec
- decimalt
- stringe
- enumurl
- path to external file
File association and format
.storm - is preferred extension for STORM files
#this is a comment
#b - means "boolean" and can be one of case-insensitives values 'yes' or '1' or 'tRuE' or 'no' or '0' or 'fAlSe'
param_1:b = yes
#i - means "integer"
param_2:i = -123
#f - means "float"
param_3:f = 32.32
#t - means "text" or "string"
param_4:t = this is a single line
param_5:t = "and this is a multi line
also called \"The King of Strings\".
It's not a joke!"
#objects should be mapped w/o any type
obj_1 = {
field_1:t = "I'm a first field"
field_2:s = 123
field_3 = {
arg_1:i = 123
arg_2:sbt = 4
}
}
#arrays should be mapped w/o any type as well
#also all array values can no have names
array_1 = [
:t = "first element"
:t =second element
:t = "3rd element
in two lines"
]
#any inline objects should be mapped via type 'url'
obj = {
internal:url = file:///home/user/internal.storm
external:url = http://youhostname.domain/files/external.storm
}
Features
- All types of primitive types
- Enum deserialization from strings or numbers
- Single-line and multi-line strings
- Ability to inline any amount of inherit files (from local files or web servers)
- Customization of deserialization process (you can add support to any your custom types!)
Installation
You can install NuGet package am1goo.Storm.Net into a .NET project.
- Open a command prompt and go to your's project folder
- Use the following command to install the Storm.Net package:
dotnet add package am1goo.Storm.Net
- After the command completes, open the .csproj file in Visual Studio to see the added NuGet package reference:
<ItemGroup>
<PackageReference Include="am1goo.Storm.Net" Version="1.0.2" />
</ItemGroup>
Roadmap
- Derialization from text or file
- Serialization to text or file
- Simplified serialization/deserialization of built-in C# collection types (
List<T>
,Queue<T>
,HashSet<T>
andDictionary<KEY,VALUE>
)
Example
using Storm;
using Storm.Serializers;
public class Example
{
var settings = new StormSettings(StormSettings.Options.IgnoreCase, new List<IStormConverter>
{
new UrlStormConverter(), //added ability to load parts of data from other files
});
var serializer = new StormSerializer();
var obj = await serializer.DeserializeFileAsync("Examples/test-file.storm", settings);
/* do something with obj */
}
Requirements
- Visual Studio 2019 or higher
- .NET App 2.0 or higher
- .NET Standard 2.1 or higher
- .NET Core 5.0 and higher
Contribute
Contribution in any form is very welcome. Bugs, feature requests or feedback can be reported in form of Issues.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. 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 was computed. 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. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 is compatible. netcoreapp2.2 is compatible. netcoreapp3.0 is compatible. netcoreapp3.1 is compatible. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETCoreApp 2.0
- No dependencies.
-
.NETCoreApp 2.1
- No dependencies.
-
.NETCoreApp 2.2
- No dependencies.
-
.NETCoreApp 3.0
- No dependencies.
-
.NETCoreApp 3.1
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.