-/* $NetBSD: trade.c,v 1.4 1997/10/12 17:45:27 christos Exp $ */
+/* $NetBSD: trade.c,v 1.9 2004/01/27 20:30:30 jsm Exp $ */
/*
* Copyright (c) 1980, 1993
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
#if 0
static char sccsid[] = "@(#)trade.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: trade.c,v 1.4 1997/10/12 17:45:27 christos Exp $");
+__RCSID("$NetBSD: trade.c,v 1.9 2004/01/27 20:30:30 jsm Exp $");
#endif
#endif /* not lint */
typedef struct trd_st TRADE;
-static char *plist[MAX_PRP+2];
+static const char *plist[MAX_PRP+2];
static int used[MAX_PRP];
static TRADE trades[2];
-static void get_list __P((int, int ));
-static int set_list __P((OWN *));
-static void summate __P((void));
-static void do_trade __P((void));
-static void move_em __P((TRADE *, TRADE *));
+static void get_list(int, int );
+static int set_list(OWN *);
+static void summate(void);
+static void do_trade(void);
+static void move_em(TRADE *, TRADE *);
void
trade()
{
-
- int tradee, i;
+ int tradee, i;
trading = TRUE;
for (i = 0; i < 2; i++) {
if (getyn("Is the trade ok? ") == 0)
do_trade();
}
+
/*
* This routine gets the list of things to be trader for the
* player, and puts in the structure given.
*/
static void
get_list(struct_no, play_no)
-int struct_no, play_no;
+ int struct_no, play_no;
{
-
- int sn, pn;
- PLAY *pp;
- int numin, prop, num_prp;
- OWN *op;
- TRADE *tp;
+ int sn, pn;
+ PLAY *pp;
+ int numin, prop, num_prp;
+ OWN *op;
+ TRADE *tp;
for (numin = 0; numin < MAX_PRP; numin++)
used[numin] = FALSE;
}
}
}
+
/*
* This routine sets up the list of tradable property.
*/
static int
set_list(the_list)
-OWN *the_list;
+ OWN *the_list;
{
-
- int i;
- OWN *op;
+ int i;
+ OWN *op;
i = 0;
for (op = the_list; op; op = op->next)
plist[i--] = 0;
return i;
}
+
/*
* This routine summates the trade.
*/
static void
summate()
{
-
- bool some;
- int i;
- TRADE *tp;
- OWN *op;
+ bool some;
+ int i;
+ TRADE *tp;
+ OWN *op;
for (i = 0; i < 2; i++) {
tp = &trades[i];
printf("\t-- Nothing --\n");
}
}
+
/*
* This routine actually executes the trade.
*/
static void
do_trade()
{
-
move_em(&trades[0], &trades[1]);
move_em(&trades[1], &trades[0]);
}
+
/*
* This routine does a switch from one player to another
*/
static void
move_em(from, to)
-TRADE *from, *to;
+ TRADE *from, *to;
{
-
- PLAY *pl_fr, *pl_to;
- OWN *op;
+ PLAY *pl_fr, *pl_to;
+ OWN *op;
pl_fr = &play[from->trader];
pl_to = &play[to->trader];
}
set_ownlist(to->trader);
}
+
/*
* This routine lets a player resign
*/
void
resign()
{
-
- int i, new_own;
- OWN *op;
- SQUARE *sqp;
+ int i, new_own;
+ OWN *op;
+ SQUARE *sqp;
if (cur_p->money <= 0) {
switch (board[cur_p->loc].type) {
sqp->owner = -1;
sqp->desc->morg = FALSE;
if (sqp->type == PRPTY) {
- isnot_monop(sqp->desc->mon_desc);
+ is_not_monop(sqp->desc->mon_desc);
sqp->desc->houses = 0;
}
}