public bool TryGetGeneration(PropNodeCollectionIntInterface propItemSet, out GenerationIdType generationId) { if (_dict.TryGetValue(propItemSet, out Tuple <PropNodeCollectionIntInterface, GenerationIdType> value)) { generationId = value.Item2; return(true); } else { generationId = GenerationIdType.MaxValue; return(false); } }
public bool TryRegisterPropItemSet(PropNodeCollectionIntInterface propItemSet, PropNodeCollectionIntInterface basePropItemSet, out GenerationIdType generationId) { if (_dict.TryGetValue(basePropItemSet, out Tuple <PropNodeCollectionIntInterface, GenerationIdType> value)) { // TODO: Have the reference base supply the next available generationId. generationId = basePropItemSet.GetNextGenerationId(); Tuple <PropNodeCollectionIntInterface, GenerationIdType> entry = new Tuple <PropNodeCollectionIntInterface, GenerationIdType>(propItemSet, generationId); _dict.Add(propItemSet, entry); return(true); } else { // Could not find base, cannot register a derived PropItemSet. generationId = GenerationIdType.MaxValue; return(false); } }