aboutsummaryrefslogtreecommitdiff
path: root/assets
Commit message (Expand)AuthorAge
* Update interlocking manualorwell962019-01-15
* Signs (static signals)orwell962018-12-08
* Shunt signals (not exactly Ks), along with fixes in other components that tho...orwell962018-12-08
* Complete Ks Main signalsorwell962018-10-26
* Actually allow what manual promises (setting IP on non-assigned signals)orwell962018-10-17
* Update manual againorwell962018-10-15
* Improve route programming:orwell962018-10-07
* Add interlocking guide/manual, silence debug outputsorwell962018-09-14
* Interlocking: Create demo signals, signal API and model for TCB configurer nodeorwell962018-06-19
* Create models for Ks signalsorwell962018-06-14
* Add Andrew's Crossorwell962017-04-27
* Redo rail modelsorwell962017-03-12
* Update manual and include everything in repoorwell962017-03-09
* Remove blend1 files cluttering the assets directoryorwell962017-03-08
* Add ceiling-mounted signalorwell962017-02-28
* add wallmounted light signalorwell962017-02-03
* Create new models and textures for japanese trainorwell962017-01-24
* Update manualorwell962017-01-18
* Add detailed steam engine contributed by mbb and Krokoschlangeorwell962017-01-17
* Add animation for steam engineorwell962017-01-17
* Model, animate, texture and integrate new subway wagonorwell962017-01-17
* Download recent contributions and put them into the assets directoryorwell962017-01-17
* Add fancy passenger wagonorwell962017-01-06
* Restructure mod directoryorwell962017-01-04
e; std::string name; protected: // Only implemented by classes that have children themselves // by copying the defintion and changing that argument type (!!!) // Should defer to parent class cloneTo() if applicable and then copy // over its own properties void cloneTo(ObjDef *def) const; }; // WARNING: Ownership of ObjDefs is transferred to the ObjDefManager it is // added/set to. Note that ObjDefs managed by ObjDefManager are NOT refcounted, // so the same ObjDef instance must not be referenced multiple // TODO: const correctness for getter methods class ObjDefManager { public: ObjDefManager(IGameDef *gamedef, ObjDefType type); virtual ~ObjDefManager(); DISABLE_CLASS_COPY(ObjDefManager); // T *clone() const; // implemented in child class with correct type virtual const char *getObjectTitle() const { return "ObjDef"; } virtual void clear(); virtual ObjDef *getByName(const std::string &name) const; //// Add new/get/set object definitions by handle virtual ObjDefHandle add(ObjDef *obj); virtual ObjDef *get(ObjDefHandle handle) const; virtual ObjDef *set(ObjDefHandle handle, ObjDef *obj); //// Raw variants that work on indexes virtual u32 addRaw(ObjDef *obj); // It is generally assumed that getRaw() will always return a valid object // This won't be true if people do odd things such as call setRaw() with NULL virtual ObjDef *getRaw(u32 index) const; virtual ObjDef *setRaw(u32 index, ObjDef *obj); size_t getNumObjects() const { return m_objects.size(); } ObjDefType getType() const { return m_objtype; } const NodeDefManager *getNodeDef() const { return m_ndef; } u32 validateHandle(ObjDefHandle handle) const; static ObjDefHandle createHandle(u32 index, ObjDefType type, u32 uid); static bool decodeHandle(ObjDefHandle handle, u32 *index, ObjDefType *type, u32 *uid); protected: ObjDefManager() {}; // Helper for child classes to implement clone() void cloneTo(ObjDefManager *mgr) const; const NodeDefManager *m_ndef; std::vector<ObjDef *> m_objects; ObjDefType m_objtype; };