コード例 #1
0
        public Behavior Resume(VehicleState currentState, double speed)
        {
            // decorators
            List <BehaviorDecorator> bds = new List <BehaviorDecorator>();

            // zero decorators
            bds.Add(new TurnSignalDecorator(TurnSignal.Off));

            // get no op
            Behavior b = new NullBehavior();

            // set decorators
            b.Decorators = bds;

            // return
            return(b);
        }
コード例 #2
0
 protected ElementSpecificationAbstract(IEnumerable<ElementSpecification> children)
 {
     this.children = children.ToList();
     Borders = new Borders();
     Margins = new Margins();
     WidowHeight = 2.cm();
     OrphanHeight = 2.cm();
     Breakable = true;
     Behavior = new NullBehavior();
 }
コード例 #3
0
        // Constructors

        /// <summary>
        /// Creates new instance of <see cref="ArithmeticRules"/>.
        /// </summary>
        /// <param name="nullBehavior">Null behavior.</param>
        /// <param name="overflowBehavior">Overflow behavior.</param>
        public ArithmeticRules(NullBehavior nullBehavior, OverflowBehavior overflowBehavior)
        {
            this.nullBehavior     = nullBehavior;
            this.overflowBehavior = overflowBehavior;
        }