Drake53 / War3Api

Warcraft III's Common and Blizzard API's in C#.
MIT License
23 stars 4 forks source link

Add the ability to cast from ObjectModification to BaseObject-derived classes #10

Closed YakaryBovine closed 2 years ago

YakaryBovine commented 2 years ago

This adds the ability to cast from ObjectModification to BaseObject-derived classes, except for Ability.

I had to make a significant compromise to achieve this; namely, I removed the default ObjectDatabase and gave responsibility of BaseObject data management to the ObjectDatabase class. This means that BaseObjects can be treated as data containers with no responsibility, such that they can be both read to and written from. As a positive side effect, this means that BaseObject has a dumb constructor.

I appreciate that I may or may not have executed this in the matter that you would prefer, but I went ahead anyway because I'm extremely enthusiastic about seeing such a feature implemented.

closes #9

Drake53 commented 2 years ago

I appreciate the effort, but I decided to implement this myself, so closing this.