- Install the tool installer with .NET Core CLI:
dotnet tool install --global gti
. - Save the
tools.gti
file. - In the directory with the file run
gti -c install
.
a few points on how things (should) work:
- A modifier without conditions/repeats will always be applied
- A modifier with conditions/repeats will be applied if the conditions are met (if the condition is "true")
- BattleScribe doesn't randomly "pick" which modifiers to apply - any modifiers will apply assuming their conditions are met Groups:
- A modifier group has conditions/repeats, and also modifiers. all modifiers in the group are applied if the condition group's conditions are met
- Modifiers in a group can also have their own conditions. These modifiers will only be applied if the group's conditions are met and the modifier's own conditions Note that all conditions must be met before a modifier or group is applied. You can use "and" and "or" condition groups to define more specific behaviour/condition combinations The upshot: both your methods for the dog handler should work:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using CodeGeneration.Roslyn; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CSharp; | |
using Microsoft.CodeAnalysis.CSharp.Syntax; | |
namespace BuggedGenerator |
# in repo directory
$files = dir * -Include *.cat,*.gst
$datas = $files | % { [xml] (cat $_) }
$roots = @($datas.catalogue, $datas.gameSystem) | % { $_ } | ? {$_}
# show all unique pub names
$roots.publications.publication.name | % { $_ } | select -Unique | sort
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install-Module -Name PowerShellForGitHub -Scope CurrentUser | |
# | |
Import-Module PowerShellForGitHub | |
function New-BsdataRepo { | |
[CmdletBinding(SupportsShouldProcess)] | |
param ( | |
# Repo description | |
[Parameter(Mandatory)] | |
[ValidateNotNullOrEmpty()] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env dotnet-script | |
// Author: Amadeusz Sadowski | |
#r "nuget: morelinq, 3.2.0" | |
#r "nuget: WarHub.ArmouryModel.Workspaces.BattleScribe, [0.7.0-beta.3]" | |
using System.Collections.Immutable; | |
using System.Text.RegularExpressions; | |
using MoreLinq; | |
using WarHub.ArmouryModel.Source; | |
using WarHub.ArmouryModel.Source.BattleScribe; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
public record class Person { | |
public required int ID { get; init; } | |
public string FirstName { get; init; } | |
public string LastName { get; init; } | |
} | |
public record class Student : Person { | |
public required double Gpa { get; init; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env dotnet-script | |
#r "nuget: System.Linq.Async, 4.1.1" | |
#r "nuget: Optional, 4.0.0" | |
#r "nuget: WarHub.ArmouryModel.Workspaces.BattleScribe, 0.11.0" | |
#r "./script/bin/netcoreapp3.1/WarHub.GodMode.SourceAnalysis.dll" | |
using WarHub.ArmouryModel.ProjectModel; | |
using WarHub.ArmouryModel.Source; | |
using WarHub.ArmouryModel.Source.BattleScribe; |
Generated XmlSerializers source code using modified wham Source Core classes from https://github.com/WarHub/wham/commit/7d6227957b1b13bd84775f83d4d9a64041d7c825
Core classes were modified to all have getters and setters.
This should make writing custom XmlSerialization source code generation easier - to have a basis.
The included code won't work primarily because of ImmutableArray. Immutable collections are not handled correctly by XmlSerializer on deserialization.
Useful links:
- How the source code is generated: