コード例 #1
0
        internal static IFact Fact(IFact f, Motor m)
        {
            IFact newFact;

            if (f.GetType().Equals(typeof(IntFact)))
            {
                int value = m.AskIntVAlue(f.Question);
                newFact = new IntFact(f.Name, value, null, 0);
            }
            else
            {
                bool value = m.AskBoolValue(f.Question);
                newFact = new BoolFact(f.Name, value, null, 0);
            }

            return(newFact);
        }