Exemple #1
0
 public Tile(EnumTiles type, Chunk chunk, Vector2 positionInWorld)
 {
     _chunk    = chunk;
     _position = positionInWorld;
     _chunkpos = chunk.WorldToChunk(positionInWorld);
     SetType(type);
     chunk.PlaceTile(this, _chunkpos);
 }
Exemple #2
0
 public void SetType(EnumTiles type)
 {
     _sheet = type switch
     {
         EnumTiles.Dirt => Sprites.TileDirtGrass,
         EnumTiles.Fresh => Sprites.TileFresh,
         EnumTiles.Grass => Sprites.TileDirtGrass,
         EnumTiles.Stone => Sprites.TileStone,
         EnumTiles.Air => null,
         _ => _sheet
     };
     TileType = type;
 }