~ubuntu-branches/ubuntu/raring/simutrans/raring-proposed

« back to all changes in this revision

Viewing changes to simconvoi.h

  • Committer: Package Import Robot
  • Author(s): Ansgar Burchardt
  • Date: 2011-11-03 19:59:02 UTC
  • mfrom: (1.2.7)
  • Revision ID: package-import@ubuntu.com-20111103195902-uopgwf488mfctb75
Tags: 111.0-1
* New upstream release.
* debian/rules: Update get-orig-source target for new upstream release.
* Use xz compression for source and binary packages.
* Use override_* targets to simplify debian/rules.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#define simconvoi_h
8
8
 
9
9
#include "simtypes.h"
 
10
#include "simunits.h"
10
11
#include "linehandle_t.h"
11
12
 
12
13
#include "ifc/sync_steppable.h"
28
29
#define CONVOI_DISTANCE           5 // total distance traveled this month
29
30
#define MAX_CONVOI_COST           6 // Total number of cost items
30
31
 
 
32
class weg_t;
31
33
class depot_t;
32
34
class karte_t;
33
35
class spieler_t;
187
189
         */
188
190
        sint16 steps_driven;
189
191
 
 
192
        /*
 
193
         * chaches the running costs
 
194
         */
 
195
        sint32 sum_running_costs;
 
196
 
190
197
        /**
191
198
        * Gesamtleistung. Wird nicht gespeichert, sondern aus den Einzelleistungen
192
199
        * errechnet.
213
220
        // cached values
214
221
        // will be recalculated if
215
222
        // recalc_data is true
 
223
        bool recalc_brake_soll;
216
224
        bool recalc_data;
217
225
        sint32 sum_friction_weight;
218
226
        sint32 speed_limit;
267
275
        koord record_pos;
268
276
 
269
277
        // needed for speed control/calculation
 
278
        sint32 brake_speed_soll;    // brake target speed
270
279
        sint32 akt_speed_soll;    // target speed
271
280
        sint32 akt_speed;               // current speed
272
281
        sint32 sp_soll;           // steps to go
357
366
        */
358
367
        void unset_line();
359
368
 
 
369
        // matches two halts; if the pos is not identical, maybe the halt still is
 
370
        bool matches_halt( const koord3d pos1, const koord3d pos2 );
 
371
 
 
372
        // updates a line schedule and tries to find the best next station to go
360
373
        void check_pending_updates();
361
374
 
362
375
        /**
425
438
        * true if in waiting state (maybe also due to starting)
426
439
        * @author hsiegeln
427
440
        */
428
 
        bool is_waiting() { return (state>=WAITING_FOR_CLEARANCE  &&  state<=CAN_START_ONE_MONTH)  ||  state==WAITING_FOR_CLEARANCE_TWO_MONTHS  ||  state==CAN_START_TWO_MONTHS;}
 
441
        bool is_waiting() { return (state>=WAITING_FOR_CLEARANCE  &&  state<=CAN_START_TWO_MONTHS)  &&  state!=SELF_DESTRUCT; }
429
442
 
430
443
        /**
431
444
        * reset state to no error message
539
552
        uint32 get_length() const;
540
553
 
541
554
        /**
 
555
         * @return length of convoi in the correct units for movement
 
556
         * @author neroden
 
557
         */
 
558
        uint32 get_length_in_steps() const { return get_length() * VEHICLE_STEPS_PER_CARUNIT; }
 
559
 
 
560
        /**
542
561
         * Add the costs for traveling one tile
543
562
         * @author Hj. Malthaner
544
563
         */
545
 
        void add_running_cost();
 
564
        void add_running_cost( const weg_t *weg );
546
565
 
547
566
        /**
548
567
         * moving the veicles of a convoi and acceleration/deacceleration
807
826
        void set_no_load(bool new_no_load) { no_load = new_no_load; }
808
827
 
809
828
        void must_recalc_data() { recalc_data = true; }
 
829
        void must_recalc_brake_soll() { recalc_brake_soll = true; }
810
830
 
811
831
        // Overtaking for convois
812
 
        virtual bool can_overtake(overtaker_t *other_overtaker, int other_speed, int steps_other, int diagonal_length);
 
832
        virtual bool can_overtake(overtaker_t *other_overtaker, int other_speed, int steps_other, int diagonal_vehicle_steps_per_tile);
813
833
};
814
834
 
815
835
#endif