private Piece createPiece(Field field, int x, int y, PcType type = PcType.Random) { if (type == PcType.Random) { type = (PcType)rand.Next((int)PcType.Leng); } var piece = new Piece(field, x, y, type); field.PutPiece(piece); return(piece); }
public bool Move(Direction direction) { Field.RemovePiece(this); bool moved = false; if (canMove(direction)) { Mover.Move(ref pos, direction); moved = true; } Field.PutPiece(this); Field.Draw(); return(moved); }
public bool Rotate(RtDirection direction) { Field.RemovePiece(this); bool rotated = false; if (canRotate(direction)) { Rotator.Rotate(Shape, direction); rotated = true; } Field.PutPiece(this); Field.Draw(); return(rotated); }
private Piece createPiece(Field field, int x, int y, PcType type = PcType.Random) { if (type == PcType.Random) { type = (PcType)rand.Next((int)PcType.Leng); } var piece = new Piece(field, x, y, type); field.PutPiece(piece); return piece; }