Exemplo n.º 1
0
        public FieldButton(Point pos, Point buttonShift, int fieldSize,
                           FieldButtonState state = FieldButtonState.blocked, ColorMode mode = ColorMode.normal) : base()
        {
            this.pos = pos;

            Height    = fieldSize;
            Width     = fieldSize;
            Location  = new Point(buttonShift.X + pos.Y * Width, buttonShift.Y + pos.X * Height);
            this.mode = mode;
            setState(state);
        }
Exemplo n.º 2
0
 public void setState(FieldButtonState state)
 {
     if (!(
             mode == ColorMode.silent &&
             (state == FieldButtonState.ship ||
              state == FieldButtonState.empty ||
              state == FieldButtonState.blended)
             ))
     {
         this.BackColor = colors[state];
     }
     this.state = state;
 }