I saw the inherit attribute and thought it could be very useful.
Can it be used with stations? Do the same tags and attributes work on an overwrite system? Can it be used with stations? For tags within tags like Events can you add an extra event without overwriting the inherited events in a sub-object?
edit: Just thought of something if they could be used for items that would be awesome.
inherit
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
Crying is not a proper retort!
-
- Developer
- Posts: 2998
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
So far the capabilities of inherit are very limited.
You can override any Event (events inside <Events> element) for any type (including stations and items)
Events are overridden on a per-event basis and it support polymorphism (e.g., if a base class fires an event with objFireEvent, then the derrived class gets a chance to handle the event)
A derrived class can call a base class event by using typFireEvent.
You may also override any StaticData elements (i.e., when getting static data using (objGetStaticData), if the derrived class doesn't have the data, we ask the class that we inherit from.
You can also override any Communications elements.
You can override any Event (events inside <Events> element) for any type (including stations and items)
Events are overridden on a per-event basis and it support polymorphism (e.g., if a base class fires an event with objFireEvent, then the derrived class gets a chance to handle the event)
A derrived class can call a base class event by using typFireEvent.
You may also override any StaticData elements (i.e., when getting static data using (objGetStaticData), if the derrived class doesn't have the data, we ask the class that we inherit from.
You can also override any Communications elements.
- Betelgeuse
- Fleet Officer
- Posts: 1920
- Joined: Sun Mar 05, 2006 6:31 am
just did a bit of testing and found that you can chain inherits.
ie x inherits from y inherits from z
x will have all the events of z and y any events or static data that they have (accounting for any overwriting)
Question is there a way of getting what class you inherit from?
ie x inherits from y inherits from z
x will have all the events of z and y any events or static data that they have (accounting for any overwriting)
Question is there a way of getting what class you inherit from?
Crying is not a proper retort!