private int TouchAndWriteTypeIdWithSimpleStamp(Type type)
{
var typeDescriptor = (TypeSimpleDescriptor)type;
int typeId;
if(types.Dictionary.TryGetValue(typeDescriptor, out typeId))
{
writer.Write(typeId);
return typeId;
}
typeId = types.AddAndAdvanceId(typeDescriptor);
writer.Write(typeId);
typeDescriptor.Write(this);
return typeId;
}