(nxtitemp, trade_getitem, trade_desc, trade_check_item_ok, nxtitem,

oprange, show_mission, nameofitem, build_mission_list_type,
unit_map, xdvisible, trdswitchown, ontradingblock, trad, check_trade,
unit_type_name, start_stop_unit, scut, scra, mission, multifire,
perform_mission, fuel, NSC_GENITEM): Replace struct genitem with
struct empobj.  Remove genitem.h and create a new file empobj.h.
Replace multiple instances of unions of ef_type structures with
one standard union empobj_storage which is a superset of the individual
instances.
This commit is contained in:
Ron Koenderink 2006-07-07 15:15:43 +00:00
parent 9e75e5e009
commit 79ee88f7c6
29 changed files with 191 additions and 270 deletions

View file

@ -41,21 +41,8 @@
#include <stddef.h>
#include "misc.h"
#include "xy.h"
#include "loan.h"
#include "nsc.h"
#include "news.h"
#include "nuke.h"
#include "plane.h"
#include "ship.h"
#include "land.h"
#include "sect.h"
#include "trade.h"
#include "treaty.h"
#include "genitem.h"
#include "nat.h"
#include "map.h"
#include "commodity.h"
#include "lost.h"
#include "empobj.h"
#include "product.h"
#include "file.h"
@ -191,20 +178,20 @@ struct castr dchr_ca[] = {
};
#define NSC_GENITEM(ef_type, ef_chr) \
{ NSC_SHORT, 0, 0, fldoff(genitem, uid), "uid", ef_type}, \
{ NSC_NATID, 0, 0, fldoff(genitem, own), "owner", EF_NATION}, \
{ NSC_XCOORD, 0, 0, fldoff(genitem, x), "xloc", EF_BAD}, \
{ NSC_YCOORD, 0, 0, fldoff(genitem, y), "yloc", EF_BAD}, \
{ NSC_CHAR, 0, 0, fldoff(genitem, type), "type", ef_chr}, \
{ NSC_CHAR, 0, 0, fldoff(genitem, effic), "effic", EF_BAD}, \
{ NSC_CHAR , 0, 0, fldoff(genitem, mobil), "mobil", EF_BAD}, \
{ NSC_UCHAR , 0, 0, fldoff(genitem, off), "off", EF_BAD}, \
{ NSC_SHORT, 0, 0, fldoff(genitem, tech), "tech", EF_BAD}, \
{ NSC_STRINGY, NSC_EXTRA, 1, fldoff(genitem, group), "group", EF_BAD}, \
{ NSC_XCOORD, 0, 0, fldoff(genitem, opx), "opx", EF_BAD}, \
{ NSC_YCOORD, 0, 0, fldoff(genitem, opy), "opy", EF_BAD}, \
{ NSC_SHORT, 0, 0, fldoff(genitem, mission), "mission", EF_MISSIONS}, \
{ NSC_SHORT, 0, 0, fldoff(genitem, radius), "radius", EF_BAD}
{ NSC_SHORT, 0, 0, fldoff(empobj, uid), "uid", ef_type}, \
{ NSC_NATID, 0, 0, fldoff(empobj, own), "owner", EF_NATION}, \
{ NSC_XCOORD, 0, 0, fldoff(empobj, x), "xloc", EF_BAD}, \
{ NSC_YCOORD, 0, 0, fldoff(empobj, y), "yloc", EF_BAD}, \
{ NSC_CHAR, 0, 0, fldoff(empobj, type), "type", ef_chr}, \
{ NSC_CHAR, 0, 0, fldoff(empobj, effic), "effic", EF_BAD}, \
{ NSC_CHAR , 0, 0, fldoff(empobj, mobil), "mobil", EF_BAD}, \
{ NSC_UCHAR , 0, 0, fldoff(empobj, off), "off", EF_BAD}, \
{ NSC_SHORT, 0, 0, fldoff(empobj, tech), "tech", EF_BAD}, \
{ NSC_STRINGY, NSC_EXTRA, 1, fldoff(empobj, group), "group", EF_BAD}, \
{ NSC_XCOORD, 0, 0, fldoff(empobj, opx), "opx", EF_BAD}, \
{ NSC_YCOORD, 0, 0, fldoff(empobj, opy), "opy", EF_BAD}, \
{ NSC_SHORT, 0, 0, fldoff(empobj, mission), "mission", EF_MISSIONS}, \
{ NSC_SHORT, 0, 0, fldoff(empobj, radius), "radius", EF_BAD}
struct castr ship_ca[] = {
NSC_GENITEM(EF_SHIP, EF_SHIP_CHR),