forked from aburch/simutrans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmarker.h
42 lines (31 loc) · 959 Bytes
/
marker.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
/*
* Copyright (c) 1997 - 2001 Hansjörg Malthaner
*
* This file is part of the Simutrans project under the artistic licence.
* (see licence.txt)
*
* Author: V. Meyer
*/
#ifndef __MARKER_H
#define __MARKER_H
#include "../tpl/slist_tpl.h"
class grund_t;
class marker_t {
// Hajo: added bit mask, because it allows a more efficient
// implementation (use & instead of %)
enum { bit_unit = (8 * sizeof(unsigned char)),
bit_mask = (8 * sizeof(unsigned char))-1 };
unsigned char *bits;
int bits_groesse;
int cached_groesse;
slist_tpl <const grund_t *> more;
public:
marker_t(int welt_groesse_x,int welt_groesse_y) : bits(NULL) { init(welt_groesse_x, welt_groesse_y); }
~marker_t();
void init(int welt_groesse_x,int welt_groesse_y);
void markiere(const grund_t *gr);
void unmarkiere(const grund_t *gr);
bool ist_markiert(const grund_t *gr) const;
void unmarkiere_alle();
};
#endif