#refactoring tileassembly

1 messages · Page 1 of 1 (latest)

winged stag
#

BuildingObjectBase : SO defines a tile that is used in a level editor. It has data to describe rules of what layer it goes onto, tooltip strings, ID for files, sprite, some basic flags, etc.

TileAssembly : BuildingObjectBase describes a rectangular array of BuildingObjectBases. TileAssembly needs ALL of BuildingObjectBase’s fields and properties. The main difference is TileAssembly has an underlying dictionary/ints/int[,] field to populate arrays of Tilebases.

Almost every property of TileAssembly is an override, where BuildingObjectBase has a virtual property returning default output. (eg TotalCells() {return 1;}).

Everything has been going great, but now if I want to inherit, I need to inherit the assembly if I want a new class to have the ability to have multitile tiles in one “thing”

#

Q: Is this inheritance scheme good? Or is refactoring worth it?