remove BlockDescriptorSource trait

This commit is contained in:
griffi-gh 2023-02-15 22:11:15 +01:00
parent b63f2e4075
commit dd382c899f
3 changed files with 12 additions and 11 deletions

View file

@ -31,12 +31,9 @@ pub enum Block {
Cobblestone,
}
pub trait BlockDescriptorSource {
fn descriptor(self) -> BlockDescriptor;
}
impl BlockDescriptorSource for Block {
impl Block {
#[inline]
fn descriptor(self) -> BlockDescriptor {
pub const fn descriptor(self) -> BlockDescriptor {
match self {
Self::Air => BlockDescriptor {
name: "air",
@ -124,9 +121,13 @@ impl CubeTexture {
}
#[derive(Clone, Copy, Debug)]
struct CrossTexture {
pub a: BlockTexture,
pub b: BlockTexture,
pub struct CrossTexture {
pub a_front: BlockTexture,
pub b_front: BlockTexture,
pub a_back: BlockTexture,
pub b_back: BlockTexture,
}
impl CrossTexture {
}
@ -140,5 +141,5 @@ pub enum CollisionType {
pub enum RenderType {
None,
SolidBlock(CubeTexture),
CrossShape,
CrossShape(CrossTexture),
}

View file

@ -1,7 +1,7 @@
use strum::{EnumIter, IntoEnumIterator};
use glam::{Vec3A, vec3a, IVec3, ivec3};
use std::mem::discriminant;
use kubi_shared::block::{Block, RenderType, BlockDescriptorSource};
use kubi_shared::block::{Block, RenderType};
use super::{chunk::CHUNK_SIZE, };
use crate::rendering::world::ChunkVertex;

View file

@ -1,6 +1,6 @@
use glam::{Vec3, IVec3};
use shipyard::{View, Component, ViewMut, IntoIter, UniqueView, track};
use kubi_shared::block::{Block, BlockDescriptorSource};
use kubi_shared::block::Block;
use crate::transform::Transform;
use super::ChunkStorage;