internal static ContentHeader Create(Engine.EngineBuildHandle gameBuild) { if (gameBuild.IsWithinSameBranch(Engine.EngineRegistry.EngineBranchHaloReach)) return new Games.HaloReach.RuntimeData.ContentHeaderHaloReach(gameBuild); if (gameBuild.IsWithinSameBranch(Engine.EngineRegistry.EngineBranchHalo4)) return new Games.Halo4.RuntimeData.ContentHeaderHalo4(gameBuild); throw new KSoft.Debug.UnreachableException(gameBuild.ToDisplayString()); }
public static ContentMiniMetadata Create(Engine.EngineBuildHandle gameBuild) { if (gameBuild.IsWithinSameBranch(Engine.EngineRegistry.EngineBranchHaloReach)) { return(new Games.HaloReach.RuntimeData.ContentMiniMetadataHaloReach(gameBuild)); } if (gameBuild.IsWithinSameBranch(Engine.EngineRegistry.EngineBranchHalo4)) { return(new Games.Halo4.RuntimeData.ContentMiniMetadataHalo4(gameBuild)); } throw new KSoft.Debug.UnreachableException(gameBuild.ToDisplayString()); }
public BlobGroupVersionAndBuildInfo FindMostRelaventVersionInfo(Engine.EngineBuildHandle forBuild) { if (forBuild.IsNone) { throw new ArgumentNoneException(nameof(forBuild)); } BlobGroupVersionAndBuildInfo exact_match = null; BlobGroupVersionAndBuildInfo most_relevant = null; int possibly_relevant_count = 0; foreach (var kvp in VersionAndBuildMap) { var possible_info = kvp.Value; // Solves for versions tied to a specific revision, if any if (exact_match == null && possible_info.BuildHandle == forBuild) { exact_match = possible_info; } // Else, find the last one in the branch if (forBuild.IsWithinSameBranch(possible_info.BuildHandle)) { most_relevant = possible_info; possibly_relevant_count++; } } return(exact_match ?? most_relevant); }