コード例 #1
0
        private void SetUp()
        {
            var id = Guid.NewGuid();


            for (var i = 0; i <= height * 4; i++)
            {
                var tile = new Tile($"RightWall {i}");

                if (i == 0)
                {
                    tile.West = GlueFactory.RightWall;
                }
                else
                {
                    tile.South = G(id);
                }

                id         = Guid.NewGuid();
                tile.North = G(id);
                tiles.Add(tile);
            }

            tiles.AddRange(new [] { RightBottom, RightMiddle, RightTopZ0, RightTopZ1, LeftBottom, LeftMiddle, LeftTopZ0, LeftTopZ1 });

            RightBottom.South = G(id);
            RightBottom.North = Bind(RightBottom, RightMiddle);
            RightMiddle.South = RightBottom.North;
            RightMiddle.North = Bind(RightMiddle, RightTopZ0);
            RightTopZ0.South  = RightMiddle.North;
            RightTopZ0.Up     = Bind(RightTopZ0, RightTopZ1);
            RightTopZ1.Down   = RightTopZ0.Up;

            RightTopZ1.West = Bind(RightTopZ1, LeftTopZ1);
            LeftTopZ1.East  = RightTopZ1.West;

            LeftTopZ1.Down = Bind(LeftTopZ1, LeftTopZ0);
            LeftTopZ0.Up   = LeftTopZ1.Down;

            LeftTopZ0.South  = Bind(LeftTopZ0, LeftMiddle);
            LeftMiddle.North = LeftTopZ0.South;

            LeftMiddle.South = Bind(LeftMiddle, LeftBottom);
            LeftBottom.North = LeftMiddle.South;

            LeftBottom.South = GlueFactory.PreReadRight(Signals.Carry);
        }
コード例 #2
0
ファイル: PreReaderRight.cs プロジェクト: LoganWithers/Tiles
        private void SetUp()
        {
            var id = Guid.NewGuid();

            for (var i = 0; i < height; i++)
            {
                var tile = Tile(i);

                tile.North = i == 0 ? GlueFactory.PreReadRight(signal) : G(id);

                id = Guid.NewGuid();

                if (i + 1 == height)
                {
                    tile.West = G(id);

                    if (signal != Signals.Carry)
                    {
                        tile.South = GlueFactory.LeftWall;
                    }
                }
                else
                {
                    tile.South = G(id);
                }

                tiles.Add(tile);
            }

            var right = Tile(height);

            right.East = G(id);
            id         = Guid.NewGuid();
            right.West = G(id);
            tiles.Add(right);

            var left = Tile(height + 1);

            left.East = right.West;

            left.West = GlueFactory.Reader(signal);

            tiles.Add(left);
        }
コード例 #3
0
ファイル: CopyStopper.cs プロジェクト: LoganWithers/Tiles
        private void SetUp()
        {
            topRight    = Tile(TileNames.CopyStopperTopRight);
            topLeft     = Tile(TileNames.CopyStopperTopLeft);
            bottomLeft  = Tile(TileNames.CopyStopperBottomLeft);
            bottomRight = Tile(TileNames.CopyStopperBottomRight);

            topRight.North = GlueFactory.CopyStopper(signal);

            topRight.West = Bind(topRight, topLeft);
            topLeft.East  = topRight.West;

            topLeft.South    = Bind(topLeft, bottomLeft);
            bottomLeft.North = topLeft.South;

            bottomLeft.East  = Bind(bottomLeft, bottomRight);
            bottomRight.West = bottomLeft.East;

            bottomRight.South = GlueFactory.PreReadRight(signal);
            tiles             = new List <Tile> {
                topRight, topLeft, bottomLeft, bottomRight
            };
        }