示例#1
0
文件: SolverCopy.cs 项目: nofear/Mara
        public Goal Copy( Goal other )
        {
            Goal copy;
            if( !m_GoalMap.TryGetValue( other, out copy ) )
            {
                copy	= other.Copy( this );

                m_GoalMap[ other ]	= copy;
            }

            return copy;
        }
示例#2
0
文件: Solver.cs 项目: nofear/Mara
 public bool Solve( Goal goal )
 {
     return m_GoalStack.Solve( goal );
 }
示例#3
0
文件: GoalAnd.cs 项目: nofear/Mara
 public GoalAnd( Goal g0, Goal g1, Goal g2 )
     : this(g0.Solver, new Goal[] { g0, g1, g2 })
 {
 }
示例#4
0
文件: GoalAnd.cs 项目: nofear/Mara
 public GoalAnd( Goal g0, Goal g1 )
     : this(g0.Solver, new Goal[] { g0, g1 })
 {
 }
示例#5
0
文件: GoalAnd.cs 项目: nofear/Mara
 public GoalAnd( Goal g0 )
     : this(g0.Solver, new Goal[] { g0 })
 {
 }
示例#6
0
文件: GoalAnd.cs 项目: nofear/Mara
 public GoalAnd( Solver solver, Goal[] goalList )
     : base(solver)
 {
     m_GoalList		= goalList;
     m_Index			= new RevValue<int>( solver.StateStack, 0 );
 }
示例#7
0
文件: SolverCopy.cs 项目: nofear/Mara
        public Goal[] Copy( Goal[] other )
        {
            Goal[] copy	= new Goal[ other.Length ];
            for( int idx = 0; idx < other.Length; ++idx )
            {
                copy[ idx ]		= Copy( other[ idx ] );
            }

            return copy;
        }
示例#8
0
文件: Goal.cs 项目: nofear/Mara
 public Goal Or( Goal g0 )
 {
     return new GoalOr( this, g0 );
 }
示例#9
0
文件: GoalOr.cs 项目: nofear/Mara
 public GoalOr( Solver solver, Goal[] goalList )
     : base(solver)
 {
     m_GoalList		= goalList;
     m_Index			= 0;
 }
示例#10
0
文件: Goal.cs 项目: nofear/Mara
 public void Add( Goal goal )
 {
     m_Solver.GoalStack.Add( goal );
 }
示例#11
0
文件: Goal.cs 项目: nofear/Mara
 public Goal And( Goal g0 )
 {
     return new GoalAnd( this, g0 );
 }
示例#12
0
 public GoalAnd(Goal g0, Goal g1, Goal g2) :
     this(g0.Solver, new Goal[] { g0, g1, g2 })
 {
 }
示例#13
0
 public GoalAnd(Goal g0, Goal g1) :
     this(g0.Solver, new Goal[] { g0, g1 })
 {
 }
示例#14
0
 public GoalAnd(Goal g0) :
     this(g0.Solver, new Goal[] { g0 })
 {
 }
示例#15
0
文件: GoalStack.cs 项目: nofear/Mara
        public bool Solve( Goal goal )
        {
            Add( goal );
            Execute();

            m_IntObjective.Init();

            return !m_IsFailed;
        }
示例#16
0
文件: GoalStack.cs 项目: nofear/Mara
        public void Add( Goal goal )
        {
            m_StackAnd.Push( goal );
            m_StackAndMax	= Math.Max( m_StackAndMax, m_StackAnd.Count );

            GoalOr goalOr	= goal as GoalOr;

            if( !ReferenceEquals( goalOr, null ) )
            {
                m_StackOr.Push( goalOr );
                m_StackOrCount++;
                m_StackOrMax	= Math.Max( m_StackOrMax, m_StackOr.Count );
            }
        }