protected virtual async Task <FloorTileSide> GetFloorSide(Point point, ITile tile) { var tileData = builder.CurrentMap[point.X, point.Y]; var topleft = tileData.GrabableItems.Where(x => x.TilePosition == TilePosition.North_TopLeft).Select(x => SetupItem(x, tile)); var topRight = tileData.GrabableItems.Where(x => x.TilePosition == TilePosition.East_TopRight).Select(x => SetupItem(x, tile)); var bottomLeft = tileData.GrabableItems.Where(x => x.TilePosition == TilePosition.South_BottomLeft).Select(x => SetupItem(x, tile)); var bottomRifgh = tileData.GrabableItems.Where(x => x.TilePosition == TilePosition.West_BottomRight).Select(x => SetupItem(x, tile)); var floorTile = tileData as FloorTileData; Texture2D texture = null; if (floorTile != null) { texture = floorTile.RandomDecoration != null ? builder.FloorTextures[floorTile.RandomDecoration.Value] : null; } if (!tileData.Actuators.Any()) { var floor = new FloorTileSide(texture != null, MapDirection.Down, topleft, topRight, bottomLeft, bottomRifgh); floor.Renderer = builder.Factories.RenderersSource.GetFloorRenderer(floor, builder.WallTexture, texture); return(floor); } else { var floor = new ActuatorFloorTileSide(await floorCreator.GetFloorActuator(tileData.Actuators), texture != null, MapDirection.Down, topleft, topRight, bottomLeft, bottomRifgh); floor.Renderer = builder.Factories.RenderersSource.GetActuatorFloorRenderer(floor, builder.WallTexture, texture); return(floor); } }
public virtual IRenderer GetFloorRenderer(FloorTileSide floorTile, Texture2D wallTexture, Texture2D decorationTexture) { return(new FloorTileSideRenderer <FloorTileSide>(floorTile, wallTexture, decorationTexture)); }
public virtual IRenderer GetTeleportFloorSideRenderer(FloorTileSide floorTileSide, Texture2D wallTexture, Texture2D teleportTexture) { return(new TeleportFloorTileSideRenderer(floorTileSide, wallTexture, teleportTexture)); }