server/src/guard.h

42 lines
1.1 KiB
C
Raw Normal View History

#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;
typedef enum { E_GUARD_OK, E_GUARD_UNARMED, E_GUARD_NEWBIE, E_GUARD_FLEEING } guard_t;
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
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);
struct unit *is_guarded(struct region *r, struct unit *u, unsigned int mask);
bool is_guard(const struct unit *u, unsigned int mask);
#ifdef __cplusplus
}
#endif
#endif