-
-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reformed inventory operations, and fixed bugs #253
Conversation
/// Creates a clone from this. | ||
/// </summary> | ||
/// <returns>The clone <see cref="InventoryItem"/> instance.</returns> | ||
public InventoryItem CreateClone() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider implementing IClonable? Might be useful for other Classes, too. https://dotnetcoretutorials.com/2020/09/09/cloning-objects-in-c-and-net-core/ I like the idea of a CloningService which is called in the IClonable.Clone() method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it. I prefer the ICloneable interface with the T Clone () method.
case 0: | ||
ParseInventoryToInventory(packet); | ||
//e.g when equipping a Bow (see ammo) | ||
case 0: // InventoryToInventory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create an enum for the type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like this? enum InventoryOperation{ InventoryToInventory = 0, StorageToStorage = 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will do it.
I just see now, that the old methods were static. So make the new methods static too? |
I merged your pull request. I am working on inventory system. |
You know, my master :-) |
No description provided.