SerializeAttribute

From Cosmoteer Wiki
< ModdingModding/SerializeAttribute
Jump to navigation Jump to search
CalloutIconWarning.png
Work in Progress
This page is currently WORK IN PROGRESS. Some things may be missing.

Feel free to contribute and don't worry about perfection - other editors can make corrections if necessary. Just get creating!

Code location (what's this?): Halfling.Serialization.SerializeAttribute

When attributed to a field or property, allows the serialization and deserialization behavior of that field or property to be customized. If the SerializeContent attribute is defined on a class and the Explicit property is true, then only fields and properties with a Serialize attribute will be serialized and deserialized.

Part of Halfling, the game engine, this class has an effect on all parameters available for modding.

Attributes
Name Type Required? Access Default value Description
Read bool - {get; set;} true Set to false to prevent deserialization.
Write bool - {get; set;} true Set to false to prevent serialization.
Optional bool - {get; set;} false

(effectively)

Gets or sets whether the attributed field or property is optional when deserializing.

If true, the parameter can be missing from a mod's .rule file without causing a crash. If false, it's required : if you use that class and it doesn't inherit from something that sets this value, you set it or get a crash.

ReadContentOnly bool - {get; set;} false

(effectively)

DefaultValue object? - {get; set;} -
InheritMember bool - {get; set;} false

(effectively)

Gets or sets whether the MemberInfo passed when deserializing the attributed field or property will be the MemberInfo passed when deserializing the containing object, as opposed to the MemberInfo of the attributed field or property itself.

Notes

Nothing yet.

See also

Nothing yet.