BannerlordCoop
BannerlordCoop copied to clipboard
Dynamic Serialize Hero Class
Use the new DynamicModelGenerator to serialize the Hero class.
Exclude any fields that do not exist in the old HeroSerializer class.
Large classes like CharacterObject, PartyBelongedTo, Father, Mother, etc can be stubbed to a surrogate.
See DynamicModelGeneratorTests
Design Decision Creating delegates for data classes like ItemObject was very time consuming. So instead creating a serializer across all fields was easier than getting 20 fields via reflection. However, note that dynamic serialization can be more dangerous.
Design Dynamic Serializer Class Diagram
Definition of Done
- [ ] A serializer is implemented for the Hero class
- [ ] Test exists verifying that the Hero type is serializable
@garrettluskey Do you have a plan for how to test the game items without being in the game? I would have to create a "Hero" first.