コード例 #1
0
 public override bool IsLegal()
 {
     if (m_ConcreteAction == null)
     {
         return(false);
     }
     return(m_ConcreteAction.IsLegal());
 }
コード例 #2
0
        public Fork(Actor actor, ActorAction root) : base(actor)
        {
#if DEBUG
            if (!(actor.Controller is ObjectiveAI))
            {
                throw new InvalidOperationException("controller not smart enough to plan actions");
            }
            if (!root.IsLegal())
            {
                throw new ArgumentOutOfRangeException(nameof(root), root, "must be legal");
            }
            if (root is BackwardPlan)
            {
                throw new ArgumentOutOfRangeException(nameof(root), root, "must be capable of backward planning");
            }
            if (root is Fork)
            {
                throw new InvalidOperationException("fork of fork is not reasonable");
            }
#endif
            Add(root);
        }