Another approach that sounds good for your application is to have just one type with one or more fields that control the behaviour.
Thus Casters and Blockers could be collapsed into say Shape which has CastsLight and BlocksLight flags.
If the attributes and behaviours of Casters and Blockers are so similar then I would recommend this approach. It is a bit like your 'if unittype=1' approach but it makes the reasons for the different behaviour clearer. Every method/function where the light interaction is not important does not have to worry about the difference.
Alternative is to have Shape as the base and then extend it for both Caster and Blocker. BTW commonly recommended naming standard is not to use the plural form in naming objects. So Caster rather than Casters.
The issue of lists is a good example of where BlitzMax opens up whole new possibilities. You can for example maintain three lists in the type. Always add a new object to the main list but then add it to CasterList or BlockerList depending upon the attribute when it is created. This works well unless there needs to be a lot of list maintenance such as deleting objects and switching them between Caster and Blocker lists.
Which is best ? Look at the alternatives, even rough out the code for each and see which is more flexible and results in the least/clearest/cleanest code. Efficiency will probably no be much differnt and is really not that important in almost all situations unless you do something crazy.
Let us know how it turns out.
Thus Casters and Blockers could be collapsed into say Shape which has CastsLight and BlocksLight flags.
If the attributes and behaviours of Casters and Blockers are so similar then I would recommend this approach. It is a bit like your 'if unittype=1' approach but it makes the reasons for the different behaviour clearer. Every method/function where the light interaction is not important does not have to worry about the difference.
Alternative is to have Shape as the base and then extend it for both Caster and Blocker. BTW commonly recommended naming standard is not to use the plural form in naming objects. So Caster rather than Casters.
The issue of lists is a good example of where BlitzMax opens up whole new possibilities. You can for example maintain three lists in the type. Always add a new object to the main list but then add it to CasterList or BlockerList depending upon the attribute when it is created. This works well unless there needs to be a lot of list maintenance such as deleting objects and switching them between Caster and Blocker lists.
Which is best ? Look at the alternatives, even rough out the code for each and see which is more flexible and results in the least/clearest/cleanest code. Efficiency will probably no be much differnt and is really not that important in almost all situations unless you do something crazy.
Let us know how it turns out.