コード例 #1
0
        private void SetUpRealSignal()
        {
            piecePlacedSignal     = new PiecePlacedSignal();
            _instance.PiecePlaced = piecePlacedSignal;

            initializeBoardSignal     = new InitializeBoardSignal();
            _instance.InitializeBoard = initializeBoardSignal;
        }
コード例 #2
0
        public void SetUp()
        {
            setInitialStateSignal = Substitute.For <SetInitialStateSignal>();
            initializeBoardSignal = Substitute.For <InitializeBoardSignal>();
            grid = new Grid(NumRows, NumCols);

            _instance = new GameStartupCommand();
            _instance.SetInitialState = setInitialStateSignal;
            _instance.InitializeBoard = initializeBoardSignal;
            _instance.Grid            = grid;
        }
コード例 #3
0
        public void SetUp()
        {
            view = Substitute.For <BoardView>();
            piecePlacedSignal     = Substitute.For <PiecePlacedSignal>();
            initializeBoardSignal = Substitute.For <InitializeBoardSignal>();

            System.Random r = new System.Random();
            position = new GridCellKey(r.Next(8), r.Next(8));
            faction  = r.NextDouble() > .5 ? Faction.Black : Faction.White;

            go                        = GameObject.CreatePrimitive(PrimitiveType.Cube);
            _instance                 = go.AddComponent <BoardViewMediator>();
            _instance.View            = view;
            _instance.PiecePlaced     = piecePlacedSignal;
            _instance.InitializeBoard = initializeBoardSignal;
        }