2015-09-12 22:49:43 +02:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#ifndef H_GUARD
|
|
|
|
|
#define H_GUARD
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct unit;
|
2016-10-26 14:37:57 +02:00
|
|
|
|
struct region;
|
|
|
|
|
|
2015-09-12 22:49:43 +02:00
|
|
|
|
typedef enum { E_GUARD_OK, E_GUARD_UNARMED, E_GUARD_NEWBIE, E_GUARD_FLEEING } guard_t;
|
2015-09-12 23:38:31 +02:00
|
|
|
|
|
2016-10-30 05:37:12 +01:00
|
|
|
|
#define GUARD_NONE 0
|
|
|
|
|
#define GUARD_TAX 1
|
|
|
|
|
/* Verhindert Steuereintreiben */
|
|
|
|
|
#define GUARD_TRAVELTHRU 8
|
|
|
|
|
/* Blockiert Durchreisende */
|
|
|
|
|
#define GUARD_LANDING 16
|
|
|
|
|
/* Verhindert Ausstieg + Weiterreise */
|
|
|
|
|
#define GUARD_CREWS 32
|
|
|
|
|
/* Verhindert Unterhaltung auf Schiffen */
|
|
|
|
|
#define GUARD_RECRUIT 64
|
|
|
|
|
/* Verhindert Rekrutieren */
|
|
|
|
|
#define GUARD_PRODUCE 128
|
|
|
|
|
/* Verhindert Abbau von Resourcen mit RTF_LIMITED */
|
|
|
|
|
#define GUARD_ALL 0xFFFF
|
|
|
|
|
|
2015-09-12 22:49:43 +02:00
|
|
|
|
guard_t can_start_guarding(const struct unit * u);
|
|
|
|
|
void update_guards(void);
|
|
|
|
|
unsigned int getguard(const struct unit * u);
|
|
|
|
|
void setguard(struct unit * u, unsigned int flags);
|
|
|
|
|
void guard(struct unit * u, unsigned int mask);
|
|
|
|
|
|
2016-10-26 11:35:20 +02:00
|
|
|
|
struct unit *is_guarded(struct region *r, struct unit *u, unsigned int mask);
|
|
|
|
|
bool is_guard(const struct unit *u, unsigned int mask);
|
|
|
|
|
|
2015-09-12 22:49:43 +02:00
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|