コード例 #1
0
        public void ResetTest()
        {
            var expected = PcColor.None;

            target.Board.Field[0, 0]     = PcColor.Red;
            target.Board.NextField[1, 1] = PcColor.Blue;
            target.Reset();
            PcColor actual = target.Board.Field[0, 0];

            Assert.AreEqual(expected, actual);
            actual = target.Board.NextField[1, 1];
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
ファイル: Field.cs プロジェクト: hirotk/Pentia
 public void Draw(PcColor[,] cells)
 {
     for (int j = 0; j < rows; j++) {
         for (int i = 0; i < cols; i++) {
             int c = (int)field[i, j];
             this[i, j].Clip = rgColor[c];
             Canvas.SetLeft(this[i, j], (wallThickness + i - c) * cellWidth);
         }
     }
 }
コード例 #3
0
ファイル: Piece.cs プロジェクト: hirotk/Pentia
        public Piece(Field field, int x, int y, PcType type, PcColor? color= null)
        {
            this.Field = field;
            this.pos = new NPoint(x, y);
            this.Color = color ?? PC_CLRS[(int)type];

            var PcShp = PC_SHPS[(int)type];
            this.Shape = new NPoint[PcShp.Length];
            PcShp.CopyTo(this.Shape, 0);
        }