示例#1
0
        private TetrisState NewTetrisState(Tetris tetris)
        {
            UpdateQueue(tetris);
            CustomTetrisRNG rng = new CustomTetrisRNG(this);

            return(new TetrisState(new Tetris(tetris, rng), rng));
        }
示例#2
0
        public TetrisState DoMove(TetriminoState move, Pathfinder.MoveNode moveNode, bool hold)
        {
            CustomTetrisRNG childRng = new CustomTetrisRNG(tetRng);
            Tetris          child    = new Tetris(tetris, childRng);

            if (hold)
            {
                child.Hold();
            }
            Tetrimino tetrimino = child.current;

            child.pieceX        = move.x;
            child.pieceY        = move.y;
            child.pieceRotation = move.rot;
            child.HardDrop();
            child.tspin = moveNode.tspin;
            return(new TetrisState(child, childRng)
            {
                usesHeld = hold,
                tetrimino = tetrimino
            });
        }
示例#3
0
 public CustomTetrisRNG(CustomTetrisRNG from)
 {
     bot   = from.bot;
     index = from.index;
 }
示例#4
0
 public TetrisState(Tetris tetris, CustomTetrisRNG tetRng)
 {
     this.tetris = tetris;
     this.tetRng = tetRng;
     tetrimino   = tetris.current;
 }