Exemplo n.º 1
0
 public static Vector2[] GetTexture(TextureSide textureSide)
 {
     return(new[]
     {
         new Vector2(0, TileRatio * 2),
         new Vector2(0, TileRatio * 3),
         new Vector2(TileRatio, TileRatio * 3),
         new Vector2(TileRatio, TileRatio * 2),
     });
 }
Exemplo n.º 2
0
 private PointL CollateShift(TextureSide side)
 {
     return(side switch
     {
         TextureSide.Left => new PointL(1, 0, 0),
         TextureSide.Back => new PointL(0, 0, 1),
         TextureSide.Right => new PointL(-1, 0, 0),
         TextureSide.Front => new PointL(0, 0, -1),
         TextureSide.Top => new PointL(0, 1, 0),
         TextureSide.Bottom => new PointL(0, -1, 0),
         _ => throw new ArgumentOutOfRangeException()
     });
Exemplo n.º 3
0
                    public static Vector2[] GetTexture(TextureSide textureSide)
                    {
                        switch (textureSide)
                        {
                        case TextureSide.Top:
                            return(Top);

                        case TextureSide.Side:
                            return(Side);

                        case TextureSide.Bottom:
                            return(Bottom);

                        default:
                            throw new ArgumentOutOfRangeException(nameof(textureSide), textureSide, null);
                        }
                    }
Exemplo n.º 4
0
                public static Vector2[] GetTexture(TextureType textureType, TextureSide textureSide)
                {
                    switch (textureType)
                    {
                    case TextureType.Grass:
                        return(GrassBlock.GetTexture(textureSide));

                    case TextureType.Gravel:
                        return(GravelBlock.GetTexture(textureSide));

                    case TextureType.Stone:
                        return(StoneBlock.GetTexture(textureSide));

                    default:
                        throw new ArgumentOutOfRangeException(nameof(textureType), textureType, null);
                    }
                }
Exemplo n.º 5
0
            public static Vector2[] GetTexture(BiomeType biomeType, TextureType textureType, TextureSide textureSide)
            {
                switch (biomeType)
                {
                case BiomeType.Normal:
                    return(NormalBiome.GetTexture(textureType, textureSide));

                default:
                    throw new ArgumentOutOfRangeException(nameof(biomeType), biomeType, null);
                }
            }
Exemplo n.º 6
0
 public static Vector2[] GetUVs(BiomeType biomeType, TextureType textureType, TextureSide textureSide)
 {
     return(Coordinates.GetTexture(biomeType, textureType, textureSide));
 }
Exemplo n.º 7
0
 public TileTexture(BiomeType biomeType, TextureType textureType, TextureSide textureSide)
 {
     Biome = biomeType;
     Block = textureType;
     Side  = textureSide;
 }