Freeciv-3.3
Loading...
Searching...
No Matches
workertask.c
Go to the documentation of this file.
1/****************************************************************************
2 Freeciv - Copyright (C) 2004 - The Freeciv Team
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12****************************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* utility */
19#include "log.h"
20
21/* common */
22#include "city.h"
23#include "extras.h"
24#include "unit.h"
25
26#include "workertask.h"
27
28/************************************************************************/
32{
33 ptask->ptile = NULL;
34 ptask->want = 0;
35}
36
37/************************************************************************/
41{
42 if (ptask == NULL) {
43 return FALSE;
44 }
45
46 if (ptask->ptile == NULL) {
47 return FALSE;
48 }
49
50 if (ptask->act >= ACTIVITY_LAST) {
51 return FALSE;
52 }
53
55 if (ptask->tgt == NULL) {
56 return FALSE;
57 }
58 if (!is_extra_caused_by(ptask->tgt,
62 return FALSE;
63 }
64 }
65
66 return TRUE;
67}
char * incite_cost
Definition comments.c:76
enum extra_cause activity_to_extra_cause(enum unit_activity act)
Definition extras.c:1090
bool is_extra_removed_by(const struct extra_type *pextra, enum extra_rmcause rmcause)
Definition extras.c:353
enum extra_rmcause activity_to_extra_rmcause(enum unit_activity act)
Definition extras.c:1111
#define is_extra_caused_by(e, c)
Definition extras.h:203
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47
bool activity_requires_target(enum unit_activity activity)
Definition unit.c:590
bool worker_task_is_sane(struct worker_task *ptask)
Definition workertask.c:40
void worker_task_init(struct worker_task *ptask)
Definition workertask.c:31