public void SetObjectData(ISerializationData dataHolder, ISerializationContext context)
{
Decay = dataHolder.GetValue<int>("Decay");
Threshold = dataHolder.GetValue<int>("Threshold");
CauseId = dataHolder.GetValue<uint>("CauseId");
var dir = dataHolder.GetValue<string>("Direction");
Direction = !string.IsNullOrEmpty(dir) ? Name.BuildName(dir) : null;
EmotionType = dataHolder.GetValue<string>("EmotionType");
Valence = dataHolder.GetValue<EmotionValence>("Valence");
AppraisalVariables = dataHolder.GetValue<string[]>("AppraisalVariables");
InfluenceMood = dataHolder.GetValue<bool>("InfluenceMood");
this.intensityATt0 = this.Intensity = dataHolder.GetValue<float>("Intensity");
if(!(context.Context is ulong))
throw new Exception("Unable to deserialize Active Emotion. Invalid serialization context.");
this.tickATt0 = (ulong)context.Context;
}