Table of Contents

Class ProjectShaderChanges

Namespace
Stride.Core.Assets
Assembly
Stride.Core.Assets.dll

Decides from the state of the disk, the project and the session what a batch of file events means for shader assets.

public static class ProjectShaderChanges
Inheritance
object
ProjectShaderChanges

Remarks

The folder part of a path from a file event can be lower case, so paths are compared without case.

Methods

IsBuiltFile(string)

Whether this is the path of a file that the build of the user shaders takes.

public static bool IsBuiltFile(string path)

Parameters

path string

Returns

bool

IsShaderFile(string)

Whether this is the path of a file that has a shader asset.

public static bool IsShaderFile(string path)

Parameters

path string

Returns

bool

IsTouched(string, string, FileEventChangeType, bool)

Whether a file event on this path can change the shader assets of the project in this folder.

public static bool IsTouched(string path, string projectDirectory, FileEventChangeType changeType, bool isDirectory)

Parameters

path string

The path of the event; a rename has two of them.

projectDirectory string

The folder of the project file.

changeType FileEventChangeType

The type of the event.

isDirectory bool

Whether the event is about a folder. A deleted path can't tell.

Returns

bool

IsUnder(string, string)

Whether the path is the folder or inside the folder.

public static bool IsUnder(string path, string directory)

Parameters

path string
directory string

Returns

bool

NeedsProjectItems(IEnumerable<string>, IEnumerable<string>, Func<string, bool>, Func<string, bool>)

Whether Plan(IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, Func<string, bool>) needs the items of the project, which take an evaluation of the project to get.

public static bool NeedsProjectItems(IEnumerable<string> touchedPaths, IEnumerable<string> sessionFiles, Func<string, bool> fileExists, Func<string, bool> directoryExists)

Parameters

touchedPaths IEnumerable<string>
sessionFiles IEnumerable<string>
fileExists Func<string, bool>
directoryExists Func<string, bool>

Returns

bool

Plan(IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, IEnumerable<string>, Func<string, bool>)

Computes the actions of a batch of file events. A path can be a shader file or a folder of them.

public static List<ProjectShaderChange> Plan(IEnumerable<string> touchedPaths, IEnumerable<string> sessionFiles, IEnumerable<string> projectItems, IEnumerable<string> deletedInSession, Func<string, bool> fileExists)

Parameters

touchedPaths IEnumerable<string>

The paths of the file events.

sessionFiles IEnumerable<string>

The files of the assets in the session.

projectItems IEnumerable<string>

The files the project includes.

deletedInSession IEnumerable<string>

The files of the assets deleted in the session and not saved yet.

fileExists Func<string, bool>

Whether a file is on the disk now.

Returns

List<ProjectShaderChange>

The actions, with each path taken from the session or from the project.