﻿using System;
using System.Diagnostics;

namespace NRules.Rete
{
    [DebuggerDisplay("Fact {Object}")]
    internal class Fact
    {
        private readonly Type _factType;
        private readonly object _object;

        public Fact()
        {
        }

        public Fact(object @object)
        {
            _object = @object;
            _factType = @object.GetType();
        }

        public Type FactType
        {
            get { return _factType; }
        }

        public object RawObject
        {
            get { return _object; }
        }

        public virtual object Object
        {
            get { return _object; }
        }
    }

    internal class WrapperFact : Fact
    {
        public WrapperFact(Tuple tuple)
            : base(tuple)
        {
        }

        public override object Object
        {
            get { return WrappedTuple.RightFact.Object; }
        }

        public Tuple WrappedTuple
        {
            get { return (Tuple) RawObject; }
        }
    }
}
﻿using System;
using System.Diagnostics;

namespace NRules.Rete
{
    [DebuggerDisplay("Fact {Object}")]
    internal class Fact
    {
        private readonly Type _factType;
        private readonly object _object;

        public Fact()
        {
        }

        public Fact(object @object)
        {
            _object = @object;
            _factType = @object.GetType();
        }

        public virtual Type FactType
        {
            get { return _factType; }
        }

        public object RawObject
        {
            get { return _object; }
        }

        public virtual object Object
        {
            get { return _object; }
        }
    }

    internal class WrapperFact : Fact
    {
        public WrapperFact(Tuple tuple)
            : base(tuple)
        {
        }

        public override Type FactType
        {
            get { return WrappedTuple.RightFact.FactType; }
        }

        public override object Object
        {
            get { return WrappedTuple.RightFact.Object; }
        }

        public Tuple WrappedTuple
        {
            get { return (Tuple) RawObject; }
        }
    }
}
Fix wrapper fact to show proper type
Fix wrapper fact to show proper type
