2010-08-08 10:06:34 +02:00
|
|
|
#ifndef H_KRNL_BUILD
|
|
|
|
#define H_KRNL_BUILD
|
|
|
|
|
|
|
|
#include "types.h"
|
2014-06-16 03:34:39 +02:00
|
|
|
#include "direction.h"
|
2014-06-21 08:59:04 +02:00
|
|
|
#include "skill.h"
|
2010-08-08 10:06:34 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/* Die enums fuer Gebauede werden nie gebraucht, nur bei der Bestimmung
|
|
|
|
* des Schutzes durch eine Burg wird die Reihenfolge und MAXBUILDINGS
|
|
|
|
* wichtig
|
2011-03-07 08:02:35 +01:00
|
|
|
*/
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
typedef struct requirement {
|
|
|
|
const struct resource_type *rtype;
|
|
|
|
int number;
|
|
|
|
} requirement;
|
|
|
|
|
|
|
|
typedef struct construction {
|
|
|
|
skill_t skill; /* skill req'd per point of size */
|
|
|
|
int minskill; /* skill req'd per point of size */
|
|
|
|
|
|
|
|
int maxsize; /* maximum size of this type */
|
|
|
|
int reqsize; /* size of object using up 1 set of requirement. */
|
|
|
|
requirement *materials; /* material req'd to build one object */
|
|
|
|
} construction;
|
|
|
|
|
2015-10-13 22:56:16 +02:00
|
|
|
void free_construction(struct construction *cons);
|
2017-03-18 18:24:02 +01:00
|
|
|
int destroy_cmd(struct unit *u, struct order *ord);
|
|
|
|
int leave_cmd(struct unit *u, struct order *ord);
|
2015-01-30 20:37:14 +01:00
|
|
|
|
2015-08-27 16:59:39 +02:00
|
|
|
void build_road(struct unit *u, int size, direction_t d);
|
|
|
|
void create_ship(struct unit *u, const struct ship_type *newtype,
|
|
|
|
int size, struct order *ord);
|
|
|
|
void continue_ship(struct unit *u, int size);
|
2015-01-30 20:37:14 +01:00
|
|
|
|
|
|
|
struct building *getbuilding(const struct region *r);
|
|
|
|
struct ship *getship(const struct region *r);
|
|
|
|
|
|
|
|
void shash(struct ship *sh);
|
|
|
|
void sunhash(struct ship *sh);
|
2017-03-18 18:24:02 +01:00
|
|
|
int roqf_factor(void);
|
2015-01-30 20:37:14 +01:00
|
|
|
|
2019-10-21 20:04:32 +02:00
|
|
|
int build(struct unit *u, int number, const construction * ctype, int completed, int want, int skill_mod);
|
2017-03-18 18:24:02 +01:00
|
|
|
int maxbuild(const struct unit *u, const construction * cons);
|
|
|
|
struct message *msg_materials_required(struct unit *u, struct order *ord,
|
|
|
|
const struct construction *ctype, int multi);
|
|
|
|
|
2015-01-30 20:37:14 +01:00
|
|
|
/** error messages that build may return: */
|
2010-08-08 10:06:34 +02:00
|
|
|
#define ELOWSKILL -1
|
|
|
|
#define ENEEDSKILL -2
|
|
|
|
#define ECOMPLETE -3
|
|
|
|
#define ENOMATERIALS -4
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|