Nicolas Winkler пре 3 година
родитељ
комит
905ff6384d
1 измењених фајлова са 44 додато и 0 уклоњено
  1. 44 0
      src/hash.rs

+ 44 - 0
src/hash.rs

@@ -0,0 +1,44 @@
+use game::Game;
+use evaluate::PosValue;
+use std::collections::{HashMap};
+use std::hash::{BuildHasher, Hasher};
+
+pub enum EntryType {
+    Value,
+    LowerBound,
+    UpperBound,
+}
+
+pub struct CacheEntry {
+    entry_type: EntryType,
+    depth: i32,
+    value: PosValue
+}
+
+pub struct Cache {
+    hashmap: HashMap<Game, CacheEntry>,
+}
+
+pub struct GameHasher {
+}
+
+impl Hasher for GameHasher {
+    type Hasher = Self;
+
+    fn build_hasher(&self) -> Self::Hasher {
+        GameHasher {}
+    }
+
+    fn hash_one(&self, x: &Game) -> u64 {
+        0
+    }
+}
+
+
+impl Cache {
+    pub fn new() -> Self {
+        Cache {
+            hashmap: HashMap::with_hasher(hash_builder: S)
+        }
+    }
+}