# Path: modules/game/AnalysedMove.py
# UCI = NewType('UCI', str)
# class AnalysedMove(NamedTuple('AnalysedMove', [
#         ('uci', UCI),
#         ('move', MoveNumber),
#         ('emt', Emt),
#         ('engineEval', EngineEval),
#         ('analyses', List[Analysis])
#     ])):
# class AnalysisBSONHandler:
# class AnalysedMoveBSONHandler:
#     def tensor(self, timeAvg: Number, wclAvg: Number) -> List[Number]:
#     def nullTensor() -> List[int]:
#     def top(self) -> Opt[Analysis]:
#     def difToNextBest(self) -> Number:
#     def difToNextWorst(self) -> Number:
#     def PVsWinningChancesLoss(self) -> Number:
#     def averageWinningChancesLoss(self) -> Number:
#     def winningChancesLoss(self, usePV: bool = False) -> Number:
#     def advantage(self) -> Number:
#     def ambiguity(self) -> int: # 1 = only one top move, 5 = all moves good
#     def trueRank(self) -> TrueRank:
#     def rank(self) -> Rank:
#     def projectedRank(self) -> Number:
# def winningChances(engineEval: EngineEval) -> Number:
# def similarChances(c1: Number, c2: Number) -> bool:
#     def reads(bson: Dict) -> Analysis:
#     def writes(analysis: Analysis) -> Dict:
#     def reads(bson: Dict) -> AnalysedMove:
#     def writes(analysedMove: AnalysedMove) -> Dict:


from default_imports import *
from modules.game.AnalysedMove import Analysis, AnalysisBSONHandler
from chess import polyglot, Board
from pymongo.collection import Collection
import pymongo
import logging


AnalysedPositionID = NewType('AnalysedPositionID', str)

class AnalysedPosition(NamedTuple('AnalysedPosition', [
        ('id', AnalysedPositionID),
        ('analyses', List[Analysis])
    ])):
    """
    Like an analysed move, but only with SF analysis. Does not contain any other move data.
    This is used for accelerating stockfish analysis.
    """
    @staticmethod

# Path: modules/game/AnalysedMove.py
# UCI = NewType('UCI', str)
# class AnalysedMove(NamedTuple('AnalysedMove', [
#         ('uci', UCI),
#         ('move', MoveNumber),
#         ('emt', Emt),
#         ('engineEval', EngineEval),
#         ('analyses', List[Analysis])
#     ])):
# class AnalysisBSONHandler:
# class AnalysedMoveBSONHandler:
#     def tensor(self, timeAvg: Number, wclAvg: Number) -> List[Number]:
#     def nullTensor() -> List[int]:
#     def top(self) -> Opt[Analysis]:
#     def difToNextBest(self) -> Number:
#     def difToNextWorst(self) -> Number:
#     def PVsWinningChancesLoss(self) -> Number:
#     def averageWinningChancesLoss(self) -> Number:
#     def winningChancesLoss(self, usePV: bool = False) -> Number:
#     def advantage(self) -> Number:
#     def ambiguity(self) -> int: # 1 = only one top move, 5 = all moves good
#     def trueRank(self) -> TrueRank:
#     def rank(self) -> Rank:
#     def projectedRank(self) -> Number:
# def winningChances(engineEval: EngineEval) -> Number:
# def similarChances(c1: Number, c2: Number) -> bool:
#     def reads(bson: Dict) -> Analysis:
#     def writes(analysis: Analysis) -> Dict:
#     def reads(bson: Dict) -> AnalysedMove:
#     def writes(analysedMove: AnalysedMove) -> Dict:


# Path: modules/game/AnalysedPosition.py
from default_imports import *
from modules.game.AnalysedMove import Analysis, AnalysisBSONHandler
from chess import polyglot, Board
from pymongo.collection import Collection
import pymongo
import logging



AnalysedPositionID = NewType('AnalysedPositionID', str)

class AnalysedPosition(NamedTuple('AnalysedPosition', [
        ('id', AnalysedPositionID),
        ('analyses', List[Analysis])
    ])):
    """
    Like an analysed move, but only with SF analysis. Does not contain any other move data.
    This is used for accelerating stockfish analysis.
    """
    @staticmethod

    def fromBoardAndAnalyses(board: Board, analyses: List[Analysis]):