public bool TryToStore(GameState gs, List <Vector2> bestPoses, int score, TFlag flag, int depth) { ulong hashKey = zoHash.GetHashKey(gs); if (!dict.ContainsKey(hashKey)) { //Console.WriteLine("TT stored with hash key = " + hashKey); dict[hashKey] = new TTProperty(bestPoses, score, flag, depth); return(true); } else { return(false); } }
public TTProperty Retrieve(GameState gs) { TTProperty ret = null; ulong hashKey = zoHash.GetHashKey(gs); if (dict.TryGetValue(hashKey, out ret)) { return(ret); } else { var invalidPoses = new List <Vector2>(); invalidPoses.Add(new Vector2(Constants.INVALID_VECTOR2)); ret = new TTProperty(invalidPoses, 0, TFlag.EXACT_VALUE, -1); return(ret); } }