Freeciv-3.2
Loading...
Searching...
No Matches
server
advisors
advtools.h
Go to the documentation of this file.
1
/***********************************************************************
2
Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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
#ifndef FC__ADVTOOLS_H
14
#define FC__ADVTOOLS_H
15
16
/* common */
17
#include "
fc_types.h
"
18
19
#define MORT 24
20
21
/* relative comparison for equality of floats */
22
#define FC_EPSILON (0.001)
23
#define ADV_WANTS_EQ(_w1, _w2) (fabs((_w1) - (_w2)) < FC_EPSILON * (fabs((float) (_w1)) + fabs((float) (_w2))))
24
25
adv_want
amortize
(
adv_want
benefit
,
int
delay
);
26
27
/*
28
* To prevent integer overflows the product "power * hp * firepower"
29
* is divided by POWER_DIVIDER.
30
*
31
*/
32
#define POWER_DIVIDER (POWER_FACTOR * 3)
33
34
#endif
/* FC__ADVTOOLS_H */
amortize
adv_want amortize(adv_want benefit, int delay)
Definition
advtools.c:29
incite_cost
char * incite_cost
Definition
comments.c:75
fc_types.h
adv_want
float adv_want
Definition
fc_types.h:1354
Generated on Sun Dec 22 2024 23:00:34 for Freeciv-3.2 by
1.9.8