SimcProfileParser 2.1.0
See the version list below for details.
dotnet add package SimcProfileParser --version 2.1.0
NuGet\Install-Package SimcProfileParser -Version 2.1.0
<PackageReference Include="SimcProfileParser" Version="2.1.0" />
<PackageVersion Include="SimcProfileParser" Version="2.1.0" />
<PackageReference Include="SimcProfileParser" />
paket add SimcProfileParser --version 2.1.0
#r "nuget: SimcProfileParser, 2.1.0"
#addin nuget:?package=SimcProfileParser&version=2.1.0
#tool nuget:?package=SimcProfileParser&version=2.1.0
Simc Profile Parser
A library to parse items in the simc import format into functional objects.
PLEASE NOTE: This library is still a work in progress and is being created to support another project.
Please raise an issue if something isn't working as you would expect or throws a NotYetImplemented
exception and it may be prioritised.
Usage
Initialising
Instance Creation
A new instance can be manually created.
ISimcGenerationService sgs = new SimcGenerationService();
To provide logging to the new instance and its children, supply an ILoggerFactory
:
ISimcGenerationService sgs = new SimcGenerationService(myLoggerFactory);
Using Dependency Injection
To implement this using Dependency Injection register it alongside your other services configuration
using the AddSimcProfileParser()
extension method when configuring your DI services:
public void ConfigureServices(IServiceCollection services)
{
services.AddSimcProfileParser();
}
Then you request an instance of ISimcGenerationService
through DI in your class constructors:
class MyClass
{
private readonly ISimcGenerationService _simcGenerationService;
public MyClass(ISimcGenerationService simcGenerationService)
{
_simcGenerationService = simcGenerationService;
}
}
Examples
Parsing profile files/strings
Generating a profile object from a simc import file named import.simc
:
ISimcGenerationService sgs = new SimcGenerationService();
// Using async
var profile = await sgs.GenerateProfileAsync(File.ReadAllText("import.simc"));
Console.WriteLine($"Profile object created for player {profile.Name}.");
You can also generate a profile object from individual lines of an import file:
ISimcGenerationService sgs = new SimcGenerationService();
var lines = new List<string>()
{
"level=70",
"main_hand=,id=178473,bonus_id=6774/1504/6646"
};
var profile = await sgs.GenerateProfileAsync(lines);
Console.WriteLine($"Profile object created for a level {profile.Level}");
Console.WriteLine($"They are weilding {profile.Items.FirstOrDefault().Name}.");
Creating a single item
There are some basic options to manually create an item using ISimcGenerationService.GenerateItemAsync
.
ISimcGenerationService sgs = new SimcGenerationService();
var itemOptions = new SimcItemOptions()
{
ItemId = 177813,
Quality = ItemQuality.ITEM_QUALITY_EPIC,
ItemLevel = 226
};
var item = await sgs.GenerateItemAsync(spellOptions);
There are other options that can be set, including bonus ids, gems and the original drop level:
public uint ItemId { get; set; }
public int ItemLevel { get; set; }
public IList<int> BonusIds { get; set; }
public IList<int> GemIds { get; set; }
public ItemQuality Quality { get; set; }
public int DropLevel { get; set; }
Creating a single spell
There are some basic options to manually create a spell using ISimcGenerationService.GenerateSpellAsync
.
There are two types of generatable spells:
- Player Scaling: the type that scale with the player level / class, such as racials.
- Item Scaling: the type that scales with the item quality/level, such as trinkets.
Generating an item scaling spell (id 343538) for a rare trinket at ilvl 226:
ISimcGenerationService sgs = new SimcGenerationService();
var spellOptions = new SimcSpellOptions()
{
ItemLevel = 226,
SpellId = 343538,
ItemQuality = ItemQuality.ITEM_QUALITY_EPIC,
ItemInventoryType = InventoryType.INVTYPE_TRINKET
};
var spell = await sgs.GenerateSpellAsync(spellOptions);
Generating an player scaling spell (id 274740):
ISimcGenerationService sgs = new SimcGenerationService();
var spellOptions = new SimcSpellOptions()
{
SpellId = 274740,
PlayerLevel = 70
};
var spell = await sgs.GenerateSpellAsync(spellOptions);
The spell object has a property ScaleBudget
which can be multiplied with a coeffecient from a spells effect if required.
Otherwise typically the BaseValue/ScaledValue of the effect will be what you're looking for.
Support
For bugs please search issues then create a new issue if needed.
For help using this library, please check the wiki or visit discord.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.2)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.2)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
2.1.1 | 68 | 5 days ago |
2.1.0 | 99 | a month ago |
2.0.4 | 100 | 2 months ago |
2.0.3 | 95 | 2 months ago |
2.0.2 | 102 | 2 months ago |
2.0.1 | 101 | 2 months ago |
2.0.0 | 97 | 2 months ago |
1.7.1 | 100 | 2 months ago |
1.7.0 | 97 | 3 months ago |
1.6.0 | 124 | 8 months ago |
1.5.0 | 166 | 9/22/2023 |
1.4.1 | 133 | 9/22/2023 |
1.3.1 | 344 | 1/4/2023 |
1.3.0 | 434 | 10/19/2022 |
1.2.0 | 692 | 9/17/2022 |
1.1.0 | 432 | 9/12/2022 |
1.0.0 | 449 | 9/7/2022 |
0.5.3.1 | 492 | 8/16/2022 |
0.5.3 | 427 | 8/16/2022 |
0.5.2 | 415 | 8/16/2022 |
0.5.1 | 382 | 8/19/2021 |
0.5.0 | 416 | 7/29/2021 |
0.4.0 | 600 | 12/6/2020 |
0.3.6 | 463 | 12/3/2020 |
0.3.5 | 432 | 11/16/2020 |
0.3.4 | 419 | 11/16/2020 |
0.3.3 | 444 | 11/13/2020 |
0.3.2 | 509 | 11/8/2020 |
0.3.1 | 461 | 11/5/2020 |
0.3.0 | 454 | 11/1/2020 |
0.2.2 | 600 | 10/28/2020 |
0.2.1 | 509 | 10/26/2020 |
0.2.0 | 510 | 10/26/2020 |
0.1.6 | 514 | 10/26/2020 |
0.1.5 | 491 | 10/18/2020 |
0.1.4 | 544 | 10/17/2020 |
0.1.3 | 489 | 10/17/2020 |
0.1.2 | 461 | 10/15/2020 |
0.1.1 | 448 | 10/15/2020 |
0.1.0 | 420 | 10/15/2020 |
0.0.6 | 562 | 10/11/2020 |
0.0.5 | 467 | 10/8/2020 |
0.0.4 | 465 | 10/7/2020 |
0.0.3 | 482 | 9/28/2020 |
0.0.2 | 504 | 9/26/2020 |
0.0.1 | 509 | 9/26/2020 |