/
world.h
60 lines (45 loc) · 1.72 KB
/
world.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
Copyright (c) 2006 Florian Wesch <fw@dividuum.de>. All Rights Reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifndef WORLD_H
#define WORLD_H
#include "path.h"
#include "packet.h"
#include "server.h"
// Begrenzt durch die Anzahl vorhandener Food Sprites
#define MAX_TILE_FOOD 9999
// XXX
typedef enum {
SOLID = 0,
PLAIN = 1,
WATER = 2,
LAVA = 3,
} maptype_e;
int world_dig(int x, int y, maptype_e type);
int world_walkable(int x, int y);
int world_get_food(int x, int y);
int world_add_food(int x, int y, int amount);
int world_food_eat(int x, int y, int amount);
int world_width();
int world_height();
int world_koth_x();
int world_koth_y();
pathnode_t *world_findpath(int x1, int y1, int x2, int y2);
void world_find_digged(int *x, int *y);
/* Network */
void world_send_initial_update(client_t *client);
void world_to_network(int x, int y, client_t *client);
void world_init(int w, int h);
void world_shutdown();
#endif