Class WildcardUtil
- Namespace
- Vintagestory.API.Util
- Assembly
- VintagestoryAPI.dll
public static class WildcardUtil
- Inheritance
-
WildcardUtil
- Inherited Members
Methods
GetWildcardValue(AssetLocation, AssetLocation)
Extract the value matched by the wildcard. For exammple for rock-* and inCode rock-granite, this method will return 'granite' Returns null if the wildcard does not match
public static string GetWildcardValue(AssetLocation wildCard, AssetLocation inCode)
Parameters
wildCard
AssetLocationinCode
AssetLocation
Returns
Match(string, string)
public static bool Match(string needle, string haystack)
Parameters
Returns
Match(string[], string)
public static bool Match(string[] needles, string haystack)
Parameters
Returns
Match(AssetLocation, AssetLocation)
public static bool Match(AssetLocation needle, AssetLocation haystack)
Parameters
needle
AssetLocationhaystack
AssetLocation
Returns
Match(AssetLocation, AssetLocation, string[])
Checks whether or not the wildcard matches for inCode, for example, returns true for wildcard rock-* and inCode rock-granite
public static bool Match(AssetLocation wildCard, AssetLocation inCode, string[] allowedVariants)
Parameters
wildCard
AssetLocationinCode
AssetLocationallowedVariants
string[]
Returns
MatchesVariants(AssetLocation, AssetLocation, string[])
public static bool MatchesVariants(AssetLocation wildCard, AssetLocation inCode, string[] allowedVariants)
Parameters
wildCard
AssetLocationinCode
AssetLocationallowedVariants
string[]
Returns
WildCardReplace(AssetLocation, AssetLocation, AssetLocation)
Returns a new AssetLocation with the wildcards (*) being filled with the blocks other Code parts, if the wildcard matches. Example this block is trapdoor-up-north. search is -up-, replace is -down-, in this case this method will return trapdoor-down-north.
public static AssetLocation WildCardReplace(this AssetLocation code, AssetLocation search, AssetLocation replace)
Parameters
code
AssetLocationsearch
AssetLocationreplace
AssetLocation