galaxyyao / TouhouGrave

Another version of Touhou Spring(https://github.com/galaxyyao/Touhou-Spring), with some adjustment in rules
3 stars 0 forks source link

Skip copying of behaviors if no member is defined on behavior instance. #57

Closed zeroyao closed 11 years ago

zeroyao commented 11 years ago

Reflect on each behavior type and see if there is some fields/properties defined on it; if not, set some flag like IsStatic to true on the model type, and skip copying of it on clone.

zeroyao commented 11 years ago

Implemented in https://github.com/galaxyyao/TouhouGrave/commit/eaf815dc4bac5b5f747a92beffc9d9d584b623fe. Behaviors with ICastableSpell is never regarded as Static because when CastSpell command is running there is no way to determine the host of the spell if the spell's Host is invalid due to being static.