Help - commands :(

Discussion in 'Plugin Development' started by Pizza371, Nov 29, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Pizza371

    Soo, I'm creating a plugin, and I have realized it is going to have a fair amount of sub-commands.
    Well, I hate having 20,000 else-if statements in one class, 2 sub-commands have taken 95 lines.. including class, package, import
    And I realized this is not going to work, it's going to get huge class file
    Has anyone got any idea on how to make this work better? I would create different classes but I need sub-commands and not commands
    Thanks!
     
  2. Pizza371
    Then why not make each one have it's own class?
     
  3. Offline

    Pizza371

    The Gaming Grunts
    I would create different classes but I need sub-commands and not commands
     
  4. Offline

    PolarCraft

    Pizza371 Well you get the args from the main command. And import that into the new class.
     
  5. Offline

    Pizza371

    PolarCraft I'm confus, how would that even work?
    Also it would be nice to be able to make easier commands, as in, a library that would help; is there any?
     
  6. Offline

    PolarCraft

    Pizza371 I have it done as I said. You need multiple classes to keep code neat and fresh. But to do that with arguments you would have to import the main class for the command. And a library um...
     
Thread Status:
Not open for further replies.

Share This Page