-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore game directory prefixes (#81)
* Fixed hiding buttons on empty * Single use specification, ignore directory prefixes * Updated changelogs
- Loading branch information
Showing
8 changed files
with
117 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Collections.Immutable; | ||
|
||
namespace TimberApi.AssetSystem | ||
{ | ||
public class AssetSpecification | ||
{ | ||
public AssetSpecification(ImmutableArray<string> ignoreDirectoryPrefixes) | ||
{ | ||
IgnoreDirectoryPrefixes = ignoreDirectoryPrefixes; | ||
} | ||
|
||
public ImmutableArray<string> IgnoreDirectoryPrefixes { get; } | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
Core/TimberApi/AssetSystem/AssetSpecificationDeserializer.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Collections.Immutable; | ||
using Timberborn.Persistence; | ||
|
||
namespace TimberApi.AssetSystem | ||
{ | ||
public class AssetSpecificationDeserializer : IObjectSerializer<AssetSpecification> | ||
{ | ||
public void Serialize(AssetSpecification value, IObjectSaver objectSaver) | ||
{ | ||
throw new System.NotImplementedException(); | ||
} | ||
|
||
public Obsoletable<AssetSpecification> Deserialize(IObjectLoader objectLoader) | ||
{ | ||
return new AssetSpecification( | ||
objectLoader.GetValueOrDefault(new ListKey<string>("IgnoreDirectoryPrefixes")).ToImmutableArray() | ||
); | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
using TimberApi.SpecificationSystem; | ||
using TimberApi.SpecificationSystem.SpecificationTypes; | ||
|
||
namespace TimberApi.AssetSystem | ||
{ | ||
public class AssetSpecificationGenerator : ISpecificationGenerator | ||
{ | ||
public IEnumerable<ISpecification> Generate() | ||
{ | ||
var json = JsonConvert.SerializeObject(new | ||
{ | ||
IgnoreDirectoryPrefixes = Array.Empty<string>(), | ||
}); | ||
|
||
yield return new GeneratedSpecification(json, "", "assetspecification"); | ||
} | ||
} | ||
} |
This file contains 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
17 changes: 14 additions & 3 deletions
17
Core/TimberApi/SpecificationSystem/SpecificationTypes/FileSpecification.cs
This file contains 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
This file contains 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
This file contains 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