#ifndef MISC_H
#define MISC_H

#include "SDL_net.h"

#include <iostream>
#include <string>

using namespace std;

// debuggin
template <class T>
void d(const T val)
{
	if (debug)
		cout << val << endl;
}
template <class T, class K>
void d(const T val, const K val2)
{
	if (debug)
		cout << val << '|' << val2 << endl;
}
template <class T, class K, class M>
void d(const T val, const K val2, const M val3)
{
	if (debug)
		cout << val << '|' << val2 << '|' << val3 << endl;
}
template <class T, class K, class M, class N>
void d(const T val, const K val2, const M val3, const N val4)
{
	if (debug)
		cout << val << '|' << val2 << '|' << val3 << '|' << val4 << endl;
}
template <class T, class K, class M, class N, class Q>
void d(const T val, const K val2, const M val3, const N val4, const Q val5)
{
	if (debug)
		cout << val << '|' << val2 << '|' << val3 << '|' << val4 << '|' << val5 << endl;
}


// errors
template <class T>
void e(const T val)
{
    cerr << val << endl;
	exit(1);
}
template <class T, class K>
void e(const T val, const K val2)
{
    cerr << val << '|' << val2 << endl;
	exit(1);
}
template <class T, class K, class M>
void e(const T val, const K val2, const M val3)
{
    cerr << val << '|' << val2 << '|' << val3 << endl;
	exit(1);
}
template <class T, class K, class M, class N>
void e(const T val, const K val2, const M val3, const N val4)
{
    cerr << val << '|' << val2 << '|' << val3 << '|' << val4 << endl;
	exit(1);
}

void send(string msg);
// get a line, one char at a time
string getline();


#endif