Hyperverse icon indicating copy to clipboard operation
Hyperverse copied to clipboard

Refactor commands

Open md5sha256 opened this issue 5 years ago • 5 comments

This PR basically overhauls the original HyperCommandManager and splits the code into two classes - HyperCommand and HyperCommandUtil. The naming schemes are not exactly ideal. The HyperCommandUtil is essentially a singleton and deals with registering contexts, completions and locale messages. I am aware it does not look like a proper singleton at this point and this should be fixed before merging.

md5sha256 avatar Jul 28 '20 15:07 md5sha256

The singleton thing should now be resolved. I guess naming schemes and the long methods are left to fix. Would it be worthwhile splitting commands of each category into their own (respective) classes?

md5sha256 avatar Jul 28 '20 15:07 md5sha256

I think we should split all context & tab completion handlers into their own (enum) singleton classes tbh, would do a lot for readability

Citymonstret avatar Jul 28 '20 15:07 Citymonstret

Right, but say we split the commands into their own classes, should we register command contexts & completions by each command group, or everything in one place (or two, as per your suggestion)?

md5sha256 avatar Jul 28 '20 15:07 md5sha256

I think we can keep the command methods in one class, but we should really be giving each context resolver its own class (because they're just interfaces)

Although I wouldn't mind splitting command categories up either, like WorldEdit does it 🤷

Citymonstret avatar Jul 28 '20 15:07 Citymonstret

Alright, I'll implement then mark dis as ready to review.

md5sha256 avatar Jul 28 '20 15:07 md5sha256