コード例 #1
0
 public void Chenquanco(Quanco q)
 {
     if (Kiemtraotrong(q))
     {
         SendNotification(Thongbao.quancoduocchenvaobang, q);
     }
 }
コード例 #2
0
        public bool Kiemtraotrong(Quanco q)
        {
            if (quan[q.X, q.Y] == null)
            {
                return(true);
            }

            SendNotification(Thongbao.vitrikhongdung);
            return(false);
        }
コード例 #3
0
        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);
            }
        }