Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved making more than one class

Comments in 'Plugin Development' started by amiremad, Apr 19, 2016.

  1. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    how to make diffrent classes

    i need a guide
  2. basprohop
    Offline

    basprohop Active Member Plugin Developer

    Joined:
    Aug 8, 2015
    Posts:
    128
    Plugins:
    3
    Minecraft User:
    basprohop
  3. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    thats php learning and i know php

    i want to know how to make pocketmine read more than one class in my plugin
  4. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    Make Class And
    To Call Class
    PHP:
    $c = new ClassName();
    Last edited: Apr 19, 2016
    amiremad likes this.
  5. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Declare a class in one of your plugin's PHP files that are loaded.
    PHP:
    class Example {
    }
    PocketMine (PHP) read it.
    amiremad likes this.
  6. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    He Know How Can Make Class But He want to call to class i think
    amiremad and HotFireyDeath like this.
  7. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    PHP:
    namespace some/name/space {

       class 
    Main {
          
    $this->secondClass = new SecondClass();
       }

       class 
    SecondClass {
       }
    }

    NOTICE
    : Don't tell me this doesn't work, this is just an simple example meaning if you know PHP you should understand this with no problem!
    amiremad likes this.
  8. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    thx guys for your help

Share This Page

Advertisement