1 /* ---------------------------------------------------------------------- *
2  * track.c
3  * This file is part of lincity.
4  * Lincity is copyright (c) I J Peters 1995-1997, (c) Greg Sharp 1997-2001.
5  * (c) Corey Keasling, 2004
6  * ---------------------------------------------------------------------- */
7 #include <lcintl.h>
8 #include <lin-city.h>
9 #include <lctypes.h>
10 #include <lcconfig.h>
11 #include <engglobs.h>
12 #include <cliglobs.h>
13 #include <stats.h>
14 #include <mps.h>
15 #include <transport.h>
16 #include <track.h>
17 
18 /* ---------------------------------------------------------------------
19    For track, road and rail:
20 
21    int_1 contains the amount of food
22    int_2 contains the amount of jobs
23    int_3 contains the amount of coal
24    int_4 contains the amount of goods
25    int_5 contains the amount of ore
26    int_6 contains the amount of steel
27    int_7 contains the amount of waste
28   --------------------------------------------------------------------- */
29 
30 
31 void
do_track(int x,int y)32 do_track (int x, int y)
33 {
34     static int wb_count = 0;
35     general_transport (&MP_INFO(x,y), &MP_POL(x,y),
36 		       MAX_WASTE_ON_TRACK, &wb_count);
37 }
38 
39 void
mps_track(int x,int y)40 mps_track (int x, int y)
41 {
42   int i = 0;
43 
44   mps_store_title(i++,_("Track"));
45   i++;
46 
47   mps_store_sfp(i++,_("Food"),
48 		MP_INFO(x,y).int_1 * 100.0 / MAX_FOOD_ON_TRACK);
49   mps_store_sfp(i++,_("Jobs"),
50 		MP_INFO(x,y).int_2 * 100.0 / MAX_JOBS_ON_TRACK);
51   mps_store_sfp(i++,_("Coal"),
52 		MP_INFO(x,y).int_3 * 100.0 / MAX_COAL_ON_TRACK);
53   mps_store_sfp(i++,_("Goods"),
54 		MP_INFO(x,y).int_4 * 100.0 / MAX_GOODS_ON_TRACK);
55   mps_store_sfp(i++,_("Ore"),
56 		MP_INFO(x,y).int_5 * 100.0 / MAX_ORE_ON_TRACK);
57   mps_store_sfp(i++,_("Steel"),
58 		MP_INFO(x,y).int_6 * 100.0 / MAX_STEEL_ON_TRACK);
59   mps_store_sfp(i++,_("Waste"),
60 		MP_INFO(x,y).int_7 * 100.0 / MAX_WASTE_ON_TRACK);
61 
62 }
63