-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnection.h
More file actions
45 lines (39 loc) · 754 Bytes
/
connection.h
File metadata and controls
45 lines (39 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <poll.h>
#include <unistd.h>
#include "exc.h"
#define BUF_SIZE 256
class connection {
pollfd fd;
int id;
void halt();
public:
connection(int, const char*);
connection();
connection& operator=(const connection&);
/*-------- commands ---------*/
void buy(int, int);
void sell(int, int);
void prod(int);
void build();
void endturn();
int my_id();
int players();
int supply();
int raw_price();
int demand();
int production_price();
int money(int);
int raw(int);
int production(int);
int factories(int);
~connection();
};
extern connection server;