示例#1
0
        public GameState(ICommand Command)
        {
            if (Command is null)
            {
                throw new ArgumentNullException("Command");
            }

            this.Command = Command;

            //
            //[ToDo]Allocate a separate Pool of positions for each thread:
            //
            PositionPool = new Pool <Position>();

            Bound = new SearchBound();
            Rule  = new CastleRule();
            Case  = new PerfCase();

            newBestMoves(wDepthMax);
            newTimers();
            SeededRandom = new Random(); // Variable seed based on Environment.TickCount

            loadEndgameValue();
            loadExtensionLimit();
#if KillerCompositionHash
            var uBottleLength = 8191U;
#else
            var uBottleLength = wPlyHistory;
#endif
#if UseKillers
            Bottle = new MoveBottle(uBottleLength);
#endif                                  // UseKillers
            wireControls();

            newNodeDelta(wDepthMax);
            newEarlyMoveCounts(wPlyHistory);
            newPVDoubleCounts(wPlyHistory);
#if MaterialBalance
            newCXPMemo(uDefaultComposition2);
#else
            newCXPMemo(uDefaultCompositions);
#endif
            newPXPMemo(uDefaultPawnPositions);

            //clear();
        }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     instance      = this;
     rb            = gameObject.GetComponent <Rigidbody>();
     startPosition = gameObject.transform.position;
 }