server/src/guard.h
Enno Rehling 3cb24299fa bug 2292: only land regions can be guarded.
https://bugs.eressea.de/view.php?id=2292
Also adding tests for every other failure reason.
2017-03-02 12:39:21 +01:00

28 lines
567 B
C

#pragma once
#ifndef H_GUARD
#define H_GUARD
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
struct unit;
struct region;
typedef enum { E_GUARD_OK, E_GUARD_UNARMED, E_GUARD_NEWBIE, E_GUARD_FLEEING, E_GUARD_TERRAIN } guard_t;
guard_t can_start_guarding(const struct unit * u);
void update_guards(void);
void setguard(struct unit * u, bool enabled);
void guard(struct unit *u);
struct unit *is_guarded(struct region *r, struct unit *u);
bool is_guard(const struct unit *u);
#ifdef __cplusplus
}
#endif
#endif