Ejemplo n.º 1
0
 public void SetUp()
 {
     color1     = new HalfBlockColor(ColorModel.RED);
     color2     = new HalfBlockColor(ColorModel.BLUE);
     colorPair1 = new ColorPair(color1, color2);
     colorPair2 = new ColorPair(color2, color1);
 }
Ejemplo n.º 2
0
 public HalfBlock(AbstractHalfBlockColor color)
 {
     if (!color.color.Equals(new Color()))
     {
         wrappedObject = new HalfBlockColorDecorator(color);
     }
 }
        public AbstractHalfBlockColor CombineColor(AbstractHalfBlockColor first, AbstractHalfBlockColor second)
        {
            ColorPair key = new ColorPair(first, second);
            AbstractHalfBlockColor _result;

            _subtractiveColorMap.TryGetValue(key, out _result);
            return(_result);
        }
Ejemplo n.º 4
0
        public void CombineColorTest(Color firstColor, Color secondColor, Color expectedColor)
        {
            AbstractHalfBlockColor first    = new HalfBlockColor(firstColor);
            AbstractHalfBlockColor second   = new HalfBlockColor(secondColor);
            AbstractHalfBlockColor expected = new HalfBlockColor(expectedColor);
            AbstractHalfBlockColor result   = first.CombineColor(second);

            Assert.True(expected.Equals(result));
        }
Ejemplo n.º 5
0
        public void CreateHalfBlocksColors()
        {
            _red    = new HalfBlockColor(ColorModel.RED);
            _yellow = new HalfBlockColor(ColorModel.YELLOW);
            _blue   = new HalfBlockColor(ColorModel.BLUE);

            _green  = new HalfBlockColor(ColorModel.GREEN);
            _orange = new HalfBlockColor(ColorModel.ORANGE);
            _purple = new HalfBlockColor(ColorModel.PURPLE);
        }
Ejemplo n.º 6
0
 public HalfBlockColorDecorator(AbstractHalfBlockColor color)
 {
     this._color = color;
 }
 private void AddMapping(ColorPair _pair, AbstractHalfBlockColor _result)
 {
     _subtractiveColorMap.Add(_pair, _result);
 }
Ejemplo n.º 8
0
 public ColorPair(AbstractHalfBlockColor first, AbstractHalfBlockColor second)
 {
     this.first  = first;
     this.second = second;
 }
Ejemplo n.º 9
0
 public override AbstractHalfBlockColor CombineColor(AbstractHalfBlockColor other)
 {
     return(_colorBehaviour.CombineColor(this, other));
 }