public void Chenquanco(Quanco q) { if (Kiemtraotrong(q)) { SendNotification(Thongbao.quancoduocchenvaobang, q); } }
public bool Kiemtraotrong(Quanco q) { if (quan[q.X, q.Y] == null) { return(true); } SendNotification(Thongbao.vitrikhongdung); return(false); }
public void Kiemtranguoithang(Quanco q) { dskq.Clear(); quan[q.X, q.Y] = q; if (Kiemtrathuattoan(q.X - 4, q.Y - 4, 1, 1, 9, q.kieu) || Kiemtrathuattoan(q.X - 4, q.Y, 1, 0, 9, q.kieu) || Kiemtrathuattoan(q.X, q.Y - 4, 0, 1, 9, q.kieu) || Kiemtrathuattoan(q.X - 4, q.Y + 4, 1, -1, 9, q.kieu)) { SendNotification(Thongbao.nguoithang, dskq); } else { SendNotification(Thongbao.tieptuc); } }