How to have includes that depend on each other? (Modular programming)
#1

Hello, I'm having trouble with including files because they depend on each other. Instead of having all the code in one file I decided to split them up in multiple include files. So I have a main file called main.pwn and I'm trying to include 2 files called Events.inc and Player.inc.

But the problem is that Events.inc uses variables that were defined in Player.inc and Player.inc uses macro's that were defined in Events.inc. I know there's an easy fix for this, but I'm trying to split up the files according to their topic, and not their code type.

So no matter what I include first, there's always going to be a problem

Код:
#include "Models/Player.inc"
#include <NewEvents>
or

Код:
#include <NewEvents>
#include "Models/Player.inc"
Is there a way to fix this problem?
Reply


Messages In This Thread
How to have includes that depend on each other? (Modular programming) - by PeanutButter - 07.02.2019, 10:47
Re: How to have includes that depend on each other? (Modular programming) - by Kaliber - 07.02.2019, 12:35
Re: How to have includes that depend on each other? (Modular programming) - by PeanutButter - 07.02.2019, 14:23

Forum Jump:


Users browsing this thread: 1 Guest(s)