X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibr2c2%2Ftracktype.h;h=7eb2bdc64d15bcfb4cbc853f14b23374583e1c1c;hb=b14059de03324aecde3efc649293d98ce5b7aaf2;hp=d38f1b21b86d4f4fdac0f4e6f84d21804189c807;hpb=1ff06c5bc46a677fa389ef86c6b26664368f1653;p=r2c2.git diff --git a/source/libr2c2/tracktype.h b/source/libr2c2/tracktype.h index d38f1b2..7eb2bdc 100644 --- a/source/libr2c2/tracktype.h +++ b/source/libr2c2/tracktype.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of R²C² -Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa +Copyright © 2006-2011 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ @@ -20,7 +20,7 @@ class TrackType public: struct Endpoint { - Point pos; + Vector pos; float dir; // Direction outwards from the endpoint unsigned paths; @@ -29,12 +29,16 @@ public: class Loader: public Msp::DataFile::BasicLoader { + private: + bool state_bits_set; + public: Loader(TrackType &); private: virtual void finish(); void part(); void position(float, float, float); + void state_bits(unsigned); }; private: @@ -42,8 +46,9 @@ private: std::string description; std::vector parts; std::vector endpoints; - bool double_address; + unsigned state_bits; unsigned autofit_preference; + std::string object; public: TrackType(const ArticleNumber &); @@ -54,14 +59,16 @@ public: float get_path_length(int) const; unsigned get_paths() const; unsigned get_n_paths() const; + unsigned get_state_bits() const { return state_bits; } bool is_turnout() const; bool is_dead_end() const; - bool is_double_address() const { return double_address; } unsigned get_autofit_preference() const { return autofit_preference; } + const std::string &get_object() const { return object; } const std::vector &get_parts() const { return parts; } const std::vector &get_endpoints() const { return endpoints; } const Endpoint &get_endpoint(unsigned) const; TrackPoint get_point(unsigned, unsigned, float) const; + bool collide_ray(const Vector &, const Vector &, float) const; private: void collect_endpoints();