Skip to content
This repository has been archived by the owner on Jul 16, 2018. It is now read-only.

STF Minecraft Plugin Conventions #18

Open
Boxxy opened this issue Jul 29, 2014 · 12 comments
Open

STF Minecraft Plugin Conventions #18

Boxxy opened this issue Jul 29, 2014 · 12 comments

Comments

@Boxxy
Copy link
Collaborator

Boxxy commented Jul 29, 2014

Class Layout, variable names, method order and other conventions will need to be finalized for STF minecraft projects for readability and collaboration.

@Boxxy Boxxy added this to the Future milestone Jul 29, 2014
@qsik
Copy link
Collaborator

qsik commented Aug 5, 2014

Classes should have a defined single function
Classes need to have dependencies and structure added to minimize referencing and allow for flexibility
Variables should be named such that one always understands what it represents (e.g. always use UUID id or Player player)
Method order not too terribly important
Spaces are important:
"if (test = test2) {
} else {
}"

@qsik qsik closed this as completed Aug 5, 2014
@qsik qsik reopened this Aug 5, 2014
@STFinancial
Copy link
Owner

I like to have functions listed in alphabetical order, or at least listed according to relevance. I can go in an attempt to refactor some of it.

@STFinancial
Copy link
Owner

Generally if you want to have clean and loosely coupled code, you need to define what you want each class to do before you make it. If you say "hey we want this feature, where should we put it?" over and over, things are bound to get messy. Every class should have a clearly designed role and purpose. For example, "dataManager" is not really all that clear of a title. There's some other stuff like that.

@STFinancial
Copy link
Owner

Like it's not clear from the naming whether "QueueManager" or "MatchManager" would take care of assigning which arena a person is given. I don't even know if these classes should be separate in the first place. I honestly don't even think FileManager should exist. I think there needs to be some methods in one of the classes (probably main) that spit back and take in what you need. Right now, we ignore (and have very few) abstraction barriers so it makes things interdependent and harder to debug.

@Boxxy
Copy link
Collaborator Author

Boxxy commented Aug 5, 2014

Queue since a player is given an arena on queue. I would imagine atleast,
matchManager would contain a list of games in progress while queue manager
would focus on players trying to find a match. I agree file manager is meh
but think any class that loads from file should just do it in their
constructor. The problem with abstraction barriers is there is not much to
abstract the program is much more procedural* than object oriented.

On Tue, Aug 5, 2014 at 2:16 PM, STFinancial notifications@github.com
wrote:

Like it's not clear from the naming whether "QueueManager" or
"MatchManager" would take care of assigning which arena a person is given.
I don't even know if these classes should be separate in the first place. I
honestly don't even think FileManager should exist. I think there needs to
be some methods in one of the classes (probably main) that spit back and
take in what you need. Right now, we ignore (and have very few) abstraction
barriers so it makes things interdependent and harder to debug.


Reply to this email directly or view it on GitHub
#18 (comment)
.

@qsik
Copy link
Collaborator

qsik commented Aug 6, 2014

I have begun working on cleaning up the classes. Check out stuff under the qsik package

@STFinancial
Copy link
Owner

I resynced the files and a ton of shit is broken. Are you sure you fixed it all? And can we not have two packages or an Arena class inside of both packages, it's ambiguous as hell.

@Boxxy
Copy link
Collaborator Author

Boxxy commented Aug 6, 2014

Probably should fork for future

On Wed, Aug 6, 2014 at 4:53 PM, STFinancial notifications@github.com
wrote:

I resynced the files and a ton of shit is broken. Are you sure you fixed
it all? And can we not have two packages or an Arena class inside of both
packages, it's ambiguous as hell.


Reply to this email directly or view it on GitHub
#18 (comment)
.

@qsik
Copy link
Collaborator

qsik commented Aug 6, 2014

Apologies. Was at work, moving over to my own branch now

@STFinancial
Copy link
Owner

Well I just don't really know what you're doing with it. If it's just code you're working on and are going to migrate over later, that's fine.

@qsik
Copy link
Collaborator

qsik commented Aug 6, 2014

it's out. you can repull

@Boxxy
Copy link
Collaborator Author

Boxxy commented Aug 8, 2014

How I see it should be/is
Offline Data: Maps, Teams, History, Player backup
Online Only Data: ArenaPlayer, Queue, Match

ArenaPlayer is a class that tracks the status of an online player related to the arena plugin and can save in game state (save items before arena starts)
Maps are just coordinates/door material
Teams are just UUIDs of players with ratings
History is just table of damage done and who won
Queue is a runnable that contains teams (added from commands) and exports them to a Match
A Match is two teams and a map

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants