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

« back to all changes in this revision

Viewing changes to boden/grund.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:
1
1
/*
2
 
 * Copyright (c) 1997 - 2001 Hansj�rg Malthaner
 
2
 * Copyright (c) 1997 - 2001 Hj Malthaner
3
3
 *
4
4
 * This file is part of the Simutrans project under the artistic licence.
5
5
 * (see licence.txt)
162
162
        // slope (now saved locally), because different grounds need differen slopes
163
163
        uint8 slope;
164
164
 
165
 
        /**
166
 
         * Description;
167
 
         *      Checks whether there is a way connection from this to gr in dv
168
 
         *      direction of the given waytype.
169
 
         *
170
 
         * Return:
171
 
         *      false, if ground is NULL (this case is explitly allowed).
172
 
         *      true, if waytype_t is invalid_wt (this case is explitly allowed)
173
 
         *      Check result otherwise
174
 
         *
175
 
         * Notice:
176
 
         *      helper function for "get_neighbour"
177
 
         *      Currently private, but it may be possible to make it public, if
178
 
         *      neeeded.
179
 
         *      Was previously a part of the simposition module.
180
 
         *
181
 
         * @author: Volker Meyer
182
 
         * @date: 21.05.2003
183
 
         */
184
 
        bool is_connected(const grund_t *gr, waytype_t wegtyp, koord dv) const;
185
 
 
186
165
public:
187
166
        /**
188
167
         * setzt die Bildnr. des anzuzeigenden Bodens
210
189
        virtual void calc_bild_internal() = 0;
211
190
 
212
191
public:
213
 
        enum typ {grund, boden, wasser, fundament, tunnelboden, brueckenboden, monorailboden };
 
192
        enum typ { boden = 1, wasser, fundament, tunnelboden, brueckenboden, monorailboden };
214
193
 
215
194
        grund_t(karte_t *welt, loadsave_t *file);
216
195
        grund_t(karte_t *welt, koord3d pos);
282
261
        * @return Der Typ des Untergrundes.
283
262
        * @author Hj. Malthaner
284
263
        */
285
 
        virtual typ get_typ() const { return grund; }
 
264
        virtual typ get_typ() const = 0;
286
265
 
287
266
        /**
288
267
        * Gibt eine Beschreibung des Untergrundes (informell) zurueck.
555
534
        */
556
535
        weg_t *get_weg(waytype_t typ) const {
557
536
                if (weg_t* const w = get_weg_nr(0)) {
558
 
                        if(w->get_waytype()==typ) {
559
 
                                return w;
560
 
                        }
561
 
                }
562
 
                if (weg_t* const w = get_weg_nr(1)) {
563
 
                        if(w->get_waytype()==typ) {
564
 
                                return w;
 
537
                        const waytype_t wt = w->get_waytype();
 
538
                        if(wt == typ) {
 
539
                                return w;
 
540
                        }
 
541
                        else if (wt > typ) {
 
542
                                // ways are ordered wrt to waytype
 
543
                                return NULL;
 
544
                        }
 
545
                        // try second way (if exists)
 
546
                        if (weg_t* const w = get_weg_nr(1)) {
 
547
                                if(w->get_waytype()==typ) {
 
548
                                        return w;
 
549
                                }
565
550
                        }
566
551
                }
567
552
                return NULL;
698
683
         *      (tunnel entries, bridge ramps and horizontal bridge start).
699
684
         *
700
685
         * Notice:
701
 
         *      Uses two helper functions "is_connected()" and "get_vmove()"
702
 
         *      Was previously a part of the simposition module.
 
686
         *      Uses helper function "get_vmove()"
703
687
         *
704
688
         * Parameters:
705
689
         *      If dir is not (-1,0), (1,0), (0,-1) or (0, 1), the function fails
719
703
 
720
704
        /**
721
705
         * Description;
722
 
         *      Check, whether it is possible that a way goes up or down in dv
 
706
         *      Check, whether it is possible that a way goes up or down in ribi
723
707
         *      direction. The result depends of the ground type (i.e tunnel entries)
724
708
         *      and the "hang_typ" of the ground.
725
709
         *
726
 
         *      Returns 1, if it is possible to go up
727
 
         *      Returns -1, if it is possible to go down
728
 
         *      Returns 0 otherwise.
 
710
         *      Returns the height if one moves in direction given by ribi
729
711
         *
 
712
         *      ribi must be a single direction!
730
713
         * Notice:
731
714
         *      helper function for "get_neighbour"
732
 
         *      Was previously a part of the simposition module.
733
715
         *
734
 
         * @author: Volker Meyer
735
 
         * @date: 21.05.2003
 
716
         * @author: Volker Meyer, dwachs
736
717
         */
737
 
        sint8 get_vmove(koord dir) const;
 
718
        sint8 get_vmove(ribi_t::ribi ribi) const;
738
719
 
739
720
        /* removes everything from a tile, including a halt but i.e. leave a
740
721
         * powerline ond other stuff