1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved Should i use multiple class?

Discussion in 'Plugin Help' started by Willoxey, May 12, 2020.

  1. Willoxey

    Willoxey Spider Jockey

    Messages:
    33
    I'm making a manual plugin of shop and there is tons of code because of the extense items. And there are different categories. So i would like to make more classes, like in the main class i have the cmd's and in the other the categories like Construction blocks, etc...
    I'll be using FormAPI and the construct form.

    So my question is, it will cause lag? or it will make it go worse or something? The shop is based in GUI. I think the 80% of the code will be public functions. And in the functions i'm adding items, etc... etc... etc...

    I'll be using this construct function
    PHP:
        private $p;
        public function 
    __construct(Main $p){
            
    $this->$p;
        }
    Thanks.
     
  2. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    You shouldn't worry about it causing "more lag".
    See here how to split your commands into multiple files:
    https://forums.pmmp.io/threads/plugin-command-v2.9320/

    By getting a better understanding of php you might be able to reduce the amount of code without the need to split it.
     
    Willoxey likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.