Skip to content

Added dimensions enum.#387

Merged
Defman merged 4 commits into
feather-rs:mainfrom
Masplus:dimensions
Mar 8, 2021
Merged

Added dimensions enum.#387
Defman merged 4 commits into
feather-rs:mainfrom
Masplus:dimensions

Conversation

@Masplus

@Masplus Masplus commented Mar 6, 2021

Copy link
Copy Markdown
Contributor

Implemented enum for dimensions

Created the functions to get the dim_id and the namespaced_id.

Implemented TryFrom and Into traits, to serialize and deserialize using the namespaced_id.

Closes #386

Comment thread libcraft/core/src/dimension.rs
Comment thread libcraft/core/src/dimension.rs Outdated
@oxkitsune

oxkitsune commented Mar 6, 2021

Copy link
Copy Markdown
Member

Not sure how I feel about the name "namespaced_id". We call it "name" everywhere else, but I think namespaced id makes more sense. But I do think that consistency is VERY important. So we need to make a choice here. What do you think @Defman

@Masplus

Masplus commented Mar 6, 2021

Copy link
Copy Markdown
Contributor Author

I'll fix it tomorrow 😃
Thanks for the fast review!

Comment thread libcraft/core/src/dimension.rs Outdated
Comment thread libcraft/core/src/dimension.rs Outdated
Comment thread libcraft/core/src/dimension.rs
@PauMAVA

PauMAVA commented Mar 7, 2021

Copy link
Copy Markdown
Member

Not sure how I feel about the name "namespaced_id". We call it "name" everywhere else, but I think namespaced id makes more sense. But I do think that consistency is VERY important. So we need to make a choice here. What do you think @Defman

Well, I think you are right. Here we have the problem of consistency and the problem of misleading names. name is a completely different term than namespaced_id. name is more like a DisplayName or PlayerName imo.

@Defman

Defman commented Mar 7, 2021

Copy link
Copy Markdown
Member
pub trait NameSpace {
  // Possible `Cow<'static, str>`, if not all namespaces are know at compile time
  fn name(&self) -> &'static str;
  // or
  fn id(&slef) -> &'static str;
  
  fn from_name(name: &str) -> Self;
  // or
  fn from_id(name: &str) -> Self;
}

@Masplus Masplus requested a review from Defman March 7, 2021 12:56

@Defman Defman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should revisit the idea of a general NameSpace trait in the future. For now we will merge and we can open an issue regarding consistency of through a shared NameSpace trait.

@PauMAVA

PauMAVA commented Mar 7, 2021

Copy link
Copy Markdown
Member

I think we should revisit the idea of a general NameSpace trait in the future. For now we will merge and we can open an issue regarding consistency of through a shared NameSpace trait.

Sounds good!

@PauMAVA PauMAVA requested review from PauMAVA and caelunshun and removed request for caelunshun March 7, 2021 13:02

@PauMAVA PauMAVA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@Schuwi Schuwi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR!

Comment thread libcraft/core/src/dimension.rs Outdated
Comment thread libcraft/core/src/dimension.rs Outdated
@Masplus

Masplus commented Mar 8, 2021

Copy link
Copy Markdown
Contributor Author

I think this is ready for merging.

@Defman Defman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good to me.

@ambeeeeee ambeeeeee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for feather in its current state.

@Defman Defman merged commit fe7fa9d into feather-rs:main Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding Dimension enum on Libcraft

6 participants