02.04.2016, 14:49
Modular programming: https://sampforum.blast.hk/showthread.php?tid=597338
I have not seen a modular gamemode yet where the modules are put in .inc files or even in the include folder. I have no idea whether doing so is a bad practice (I doubt it is).
My layout:
And I include them like this:
It's easy for me to distinguish libraries from gamemode modules doing it like this and I believe that's the only reason why it is done like this.
I could also put my modules in the include folder and include them like so:
I have not seen a modular gamemode yet where the modules are put in .inc files or even in the include folder. I have no idea whether doing so is a bad practice (I doubt it is).
My layout:
Код:
\project_folder\gamemodes\ gamemode.pwn gamemode.amx \project_folder\gamemodes\modules\ \project_folder\gamemodes\modules\player\ core.pwn connect.pwn disconnect.pwn spawn.pwn
PHP код:
#include "modules\player\core.pwn"
#include "modules\player\connect.pwn"
#include "modules\player\disconnect.pwn"
#include "modules\player\spawn.pwn"
I could also put my modules in the include folder and include them like so:
PHP код:
#include <modules\player\core.pwn>
#include <modules\player\connect.pwn>
#include <modules\player\disconnect.pwn>
#include <modules\player\spawn.pwn>