예제 #1
0
        public Tile GetTile(StairsTileData t)
        {
            SetMinimapTile(Color.Yellow);

            TileInfo <StairsTileData> stairs;

            if (t.Direction == VerticalDirection.Up)
            {
                stairs = FindStairs(tilePosition.ToGrid(), level - 1);
                return(new Stairs(tilePosition));//ghostStairs = to connect levels
            }
            else// take care of showing stairs in right direction
            {
                stairs = FindStairs(tilePosition.ToGrid(), level + 1);
                return(new Stairs(tilePosition, t.Orientation != Orientation.NorthSouth, t.Orientation != stairs.Tile.Orientation));
            }
        }
예제 #2
0
        public Tile GetTile(StairsTileData t)
        {
            SetMinimapTile(Color.Yellow);
            StairsInitializer stairsInitializer = new StairsInitializer {
                Down = t.Direction == VerticalDirection.Down
            };

            var res = new Stairs(stairsInitializer);

            SetupStairsSides(stairsInitializer, res);
            if (t.Direction == VerticalDirection.Down)
            {
                var upperStairsEntry = FindStairsEntryDirection(tilePosition.ToGrid(), -(int)tilePosition.Y);
                var lowerStairsEntry = FindStairsEntryDirection(tilePosition.ToGrid(), -(int)tilePosition.Y + 1);
                res.Renderer = builder.Factories.RenderersSource.GetUpperStairsTileRenderer(upperStairsEntry, lowerStairsEntry, res, builder.WallTexture);
            }
            else
            {
                res.Renderer = builder.Factories.RenderersSource.GetLowerStairsTileRenderer(res, builder.WallTexture);
            }

            this.initializer = stairsInitializer;
            return(res);
        }