aboutsummaryrefslogtreecommitdiff
path: root/advtrains/occupation.lua
Commit message (Collapse)AuthorAge
* Fix new green signals bug caused by old trav_lzbdata, and callback loop in ↵orwell962021-02-10
| | | | signalling formspec
* remove obsolete code/commentsorwell962019-11-26
|
* Shunting mode now couples trains on collision.Gabriel Pérez-Cerezo2019-08-11
| | | | Trains now get coupled when one of them is in coupling mode.
* No crash when train does not exist on check_collision()orwell962019-02-06
|
* Fix small bug in routeui and make another message log-onlyorwell962019-01-22
|
* Properly implement invalidate_all_paths, recheck lzb on aspect changeorwell962018-10-10
|
* Fix final bugs and to-do's (u.a.save/load system)orwell962018-06-14
|
* Mainly make collisions and coupling workorwell962018-06-14
| | | | Missing: ATC stuff, yaw problems
* Implement collisions. (does not work yet, still code errors)orwell962018-06-14
|
* Implement a reverse path lookup for trains instead of an occupations window ↵orwell962018-06-14
| | | | system
* Fix path_dir to actually be an angle, path item deletion and orientation of ↵orwell962018-06-14
| | | | | | | | wagons The occupation system as it is now will change. For each position, I will save the index in the train's path, and implement a callback system. I need this because the occupation window system will not be enough to cover all use cases (e.g. to make a train stop with it's center or back at a certain position, I need 3 different brake distances, which doesn't fit into the scheme)
* Bugfixes part 1orwell962018-06-14
| | | | There's something wrong with the new paths, next time build a path validity checker to trace the issue
* Occupation System, new train steps, still incompleteorwell962018-06-14
ass="hl slc">// This usually is the CONTENT_ value virtual u16 typeId() const = 0; virtual NodeMetadata* clone() = 0; virtual void serializeBody(std::ostream &os) = 0; virtual std::string infoText() {return "<todo: remove this text>";} virtual Inventory* getInventory() {return NULL;} // This is called always after the inventory is modified, before // the changes are copied elsewhere virtual void inventoryModified(){} protected: static void registerType(u16 id, Factory f); private: static core::map<u16, Factory> m_types; }; class SignNodeMetadata : public NodeMetadata { public: SignNodeMetadata(std::string text); //~SignNodeMetadata(); virtual u16 typeId() const; static NodeMetadata* create(std::istream &is); virtual NodeMetadata* clone(); virtual void serializeBody(std::ostream &os); virtual std::string infoText(); std::string getText(){ return m_text; } void setText(std::string t){ m_text = t; } private: std::string m_text; }; class ChestNodeMetadata : public NodeMetadata { public: ChestNodeMetadata(); ~ChestNodeMetadata(); virtual u16 typeId() const; static NodeMetadata* create(std::istream &is); virtual NodeMetadata* clone(); virtual void serializeBody(std::ostream &os); virtual std::string infoText(); virtual Inventory* getInventory() {return m_inventory;} private: Inventory *m_inventory; }; class FurnaceNodeMetadata : public NodeMetadata { public: FurnaceNodeMetadata(); ~FurnaceNodeMetadata(); virtual u16 typeId() const; virtual NodeMetadata* clone(); static NodeMetadata* create(std::istream &is); virtual void serializeBody(std::ostream &os); virtual std::string infoText(); virtual Inventory* getInventory() {return m_inventory;} virtual void inventoryModified(); private: Inventory *m_inventory; }; /* List of metadata of all the nodes of a block */ class NodeMetadataList { public: ~NodeMetadataList(); void serialize(std::ostream &os); void deSerialize(std::istream &is); // Get pointer to data NodeMetadata* get(v3s16 p); // Deletes data void remove(v3s16 p); // Deletes old data and sets a new one void set(v3s16 p, NodeMetadata *d); private: core::map<v3s16, NodeMetadata*> m_data; }; #endif