[heading]main.cpp[/heading]
#pragma once
#include <stdio.h>
#include <string>
#include "RakPeerInterface.h"
#include "MessageIdentifiers.h"
#include "BitStream.h"
#include "RakNetTypes.h" // MessageID
#include "GetTime.h"
#include <iostream>
#include <vector>
#include <fstream>
#include "Kbhit.h"
#include "Variables.h"
#include "GameSimulation.h"
#include "NetCode.h"
Player newPlayer; // a player object to give to new players.
GameSimulation game;
NetCode netConnection;
main()
[heading]gamesimulation.h[/heading]
#ifndef GAME_SIMULATION
#define GAME_SIMULAION
#include "Player.h"
class GameSimulation
{all the gamesimulation stuff (definitions)}
GameSimulation implementation
#endif
[heading]player.h[/heading]
class Player
{all the player stuff (definitions)}
Player implementation
[heading]netcode.h[/heading]
#ifndef NET_CODE
#define NET_CODE
#pragma once
#include <stdio.h>
#include <string>
#include "RakPeerInterface.h"
#include "MessageIdentifiers.h"
#include "BitStream.h"
#include "RakNetTypes.h" // MessageID
#include "GetTime.h"
#include <iostream>
#include <vector>
#include <fstream>
#include "Kbhit.h"
using namespace std;
#include "Variables.h"
#include "Player.h"
#include "GameSimulation.h"
class NetCode
{all the netcode class stuff (definitions)}
#endif
[heading]netcode.cpp[/heading]
#include "NetCode.h"
netcode method implementations
[heading]variables.h[/heading]
global variables that I want everything to be able to access; things like enums and handles
My stuff is a little jumbled around and there's some stuff commented out because I've been playing with it for like an hour trying to get it to work and now it's a bit of a mess. I hope I've made it clear what I'm trying to do.
I'm familiar with how includes work in the sense that they simply substitute in whatever they're including into the original source page, but apparently I'm missing something because I'm getting all sorts of errors of files not knowing about variable types and such. I'd paste them, but there's hundreds and I know that it's just trying to tell me that my includes aren't working right.
Basically, variables.h need to be available everywhere, the netcode needs the gamesimulation to pass it messages, and gamesimulation needs to see players. Main needs to be able to access the whole shebang. Thanks for any help you guys can give.