Esempio n. 1
0
 public ShipManager(Button btn, Button set, TextBox tbX1, TextBox tbY1, TextBox tbX2, TextBox tbY2, List <List <Button> > matrix, int n, shiptype type)
 {
     this.Btn        = btn;
     this.Set        = set;
     this.TbX1       = tbX1;
     this.TbY1       = tbY1;
     this.TbX2       = tbX2;
     this.TbY2       = tbY2;
     this.Matrix     = matrix;
     this.SoLuongTau = n;
     this.Type       = type;
 }
Esempio n. 2
0
        private bool isDestroyed(Button btn, shiptype type)
        {
            //check
            int _type = Convert.ToInt32(type) + 1;

            if (rowTest(btn, _type) || colTest(btn, _type))
            {
                if (_type == 5)
                {
                    //MessageBox.Show("Bạn đã bắn trúng tàu sân bay", "Chúc mừng");
                    if (thongBao != null)
                    {
                        thongBao(this, new GetText("Bạn đã bắn trúng tàu sân bay"));
                    }
                    return(true);
                }
                if (_type == 3)
                {
                    //MessageBox.Show("Bạn đã bắn trúng tàu khu trục", "Chúc mừng");
                    if (thongBao != null)
                    {
                        thongBao(this, new GetText("Bạn đã bắn trúng tàu khu trục"));
                    }
                    return(true);
                }
                if (_type == 2)
                {
                    //MessageBox.Show("Bạn đã bắn trúng tàu tuần dương", "Chúc mừng");
                    if (thongBao != null)
                    {
                        thongBao(this, new GetText("Bạn đã bắn trúng tàu tuần dương"));
                    }
                    return(true);
                }
                if (_type == 1)
                {
                    //MessageBox.Show("Bạn đã bắn trúng tàu đổ bộ", "Chúc mừng");
                    if (thongBao != null)
                    {
                        thongBao(this, new GetText("Bạn đã bắn trúng tàu đổ bộ"));
                    }
                    return(true);
                }
            }
            return(false);
        }
    public GameObject Spawnship(int Faction, int Model, shiptype type)
    {
        GameObject newModel;

        switch (type)
        {
        case shiptype.AI:
            //newModel =
            break;

        case shiptype.player_lead:
            break;

        case shiptype.AI_lead:
            break;
        }

        return(Spawnship(Faction, ShipModels[Model]));
    }