Example #1
0
        public override void Setup(AllPlayers all)
        {
            this.place = all.place;
            pc.ShowMessageBox = all.showMessageBox = ShowMessageBox_Menu.Checked;
            setTitle();

            inputname.allplayers = all;
            inputname.ShowDialog();
            this.all = inputname.allplayers;
        }
Example #2
0
 /// <summary>
 /// �}�s�C��(�Ĥ@��)
 /// </summary>
 public virtual void newgame()
 {
     table.clearAll();
     // �]�w4�Ӫ��a,�C�ӤH16�i
     all = new AllPlayers(4, 16);
     all.sumBrands = factory.SumBrands;
     // �]�w�֬O���a
     IamPlayer();
     // �]�w AllPlayers
     table.Setup(all);
     // �]�w�P��Ū�쪺��m
     setupPlace();
     newgame_round();
 }
Example #3
0
 public override void newgame()
 {
     table.clearAll();
     // �]�w4�Ӫ��a,�C�ӤH16�i
     all = new AllPlayers(4, 16);
     all.sumBrands = factory.SumBrands;
     // �]�w�֬O���a
     IamPlayer();
     // �]�w�m�W
     setName();
     // �]�w AllPlayers
     table.Setup(all);
     // �]�w�P��Ū�쪺��m
     setupPlace();
     // �إߵP
     creatBrands();
     // �P�B���a���
     chat.SendObject(all);
     check_newgame = true;
     newgame_round();
 }
Example #4
0
        private void updateAllPlayer(object sender, EventArgs e)
        {
            this.all = (AllPlayers)sender;
            this.table.Allplayers = this.all;

            table.Setup(all);
            clientPlace();
            this.table.updateAllPlayer();
            this.table.updateTable();
            this.table.updateInforamation();

            //this.table.updateInforamation();
        }
Example #5
0
 /// <summary>
 /// 設定玩家
 /// </summary>
 /// <param name="all">AllPlayers</param>
 public virtual void Setup(AllPlayers all)
 {
     this.all = all;
     this.place = all.place;
     pc.ShowMessageBox = all.showMessageBox = ShowMessageBox_Menu.Checked;
     setFlowLayout();
     setTitle();
 }
Example #6
0
 /// <summary>
 /// �]�w
 /// </summary>
 /// <param name="table">Table</param>
 /// <param name="all">Allplayers</param>
 public void setup(Table table,AllPlayers all)
 {
     this.table = table;
     this.all = all;
 }
Example #7
0
 public void setPlayer(AllPlayers all)
 {
     this.all = all;
     x = all.NowPlayer;
 }
Example #8
0
        public TallyTest()
        {
            BrandPlayer a = new BrandPlayer();

            a.add(new TubeBrand(1));
            a.add(new TubeBrand(1));
            a.add(new TubeBrand(1));
            a.add(new TubeBrand(1));

            a.add(new RopeBrand(1));
            a.add(new RopeBrand(1));
            a.add(new RopeBrand(1));
            a.add(new RopeBrand(1));

            a.add(new TenThousandBrand(1));
            a.add(new TenThousandBrand(1));
            a.add(new TenThousandBrand(1));
            a.add(new TenThousandBrand(1));

            a.add(new TubeBrand(9));
            a.add(new TubeBrand(9));
            a.add(new TubeBrand(9));
            a.add(new TubeBrand(9));

            a.add(new RopeBrand(9));
            a.add(new RopeBrand(9));
            a.add(new RopeBrand(9));
            a.add(new RopeBrand(9));


            //a.add(new WordBrand(4));
            a.add(new WordBrand(4));
            a.add(new WordBrand(4));

            ////a.add(new WordBrand(1));
            //a.add(new WordBrand(1));
            //a.add(new WordBrand(1));
            //a.add(new WordBrand(1));

            ////a.add(new WordBrand(2));
            //a.add(new WordBrand(2));
            //a.add(new WordBrand(2));
            //a.add(new WordBrand(2));

            ////a.add(new WordBrand(3));
            //a.add(new WordBrand(3));
            //a.add(new WordBrand(3));
            //a.add(new WordBrand(3));

            f = new Tally();

            Location   l   = new Location();
            AllPlayers all = new AllPlayers(4, 16);
            WordBrand  w   = new WordBrand(9);
            WordBrand  v   = new WordBrand(9);

            w.WhoPush = location.East;
            //v.WhoPush = location.Table;
            all.Show_Table.add(w);
            //all.NowPlayer.add(v);

            f.setPlayer(all);
            f.setPlayer(a);
            //l.next_Winer();
            f.setLocation(l, 0);

            f.ShowDialog();
        }
Example #9
0
 internal void newgame_network(AllPlayers all)
 {
     this.all = all;
     if (!check_newgame)
     {
         table.Setup(all);
         check_newgame = true;
         clientPlace();
         setInforamtion();
     }
     else
     {
         table.Allplayers = all;
         table.cleanImage();
         table.addImage();
         setInforamtion();
     }
 }
Example #10
0
        internal void SendObject(AllPlayers all)
        {
            try
            {
                if (myMark == "Server")
                {
                    for (int i = 0; i < n; i++)
                    {
                        socketStream = new NetworkStream(players[i].connection);

                        writer = new BinaryWriter(socketStream);
                        reader = new BinaryReader(socketStream);
                        writer.Write(AllPlayers_Head + getByteArrayWithObject(all).Length.ToString());
                        writer.Write(getByteArrayWithObject(all));
                    }

                }
                else
                {
                    writer.Write(AllPlayers_Head + getByteArrayWithObject(all).Length.ToString());
                    writer.Write(getByteArrayWithObject(all));
                }
            }
            catch (SocketException)
            {
                MessageBox.Show("���f�]�w���~�I");
            }
        }
Example #11
0
 public byte[] getByteArrayWithObject(AllPlayers all)
 {
     MemoryStream ms = new MemoryStream();
     BinaryFormatter bf1 = new BinaryFormatter();
     bf1.Serialize(ms, all);
     return ms.ToArray();
 }
Example #12
0
        public TallyTest()
        {
            BrandPlayer a = new BrandPlayer();
            a.add(new TubeBrand(1));
            a.add(new TubeBrand(1));
            a.add(new TubeBrand(1));
            a.add(new TubeBrand(1));

            a.add(new RopeBrand(1));
            a.add(new RopeBrand(1));
            a.add(new RopeBrand(1));
            a.add(new RopeBrand(1));

            a.add(new TenThousandBrand(1));
            a.add(new TenThousandBrand(1));
            a.add(new TenThousandBrand(1));
            a.add(new TenThousandBrand(1));

            a.add(new TubeBrand(9));
            a.add(new TubeBrand(9));
            a.add(new TubeBrand(9));
            a.add(new TubeBrand(9));

            a.add(new RopeBrand(9));
            a.add(new RopeBrand(9));
            a.add(new RopeBrand(9));
            a.add(new RopeBrand(9));

            //a.add(new WordBrand(4));
            a.add(new WordBrand(4));
            a.add(new WordBrand(4));

            ////a.add(new WordBrand(1));
            //a.add(new WordBrand(1));
            //a.add(new WordBrand(1));
            //a.add(new WordBrand(1));

            ////a.add(new WordBrand(2));
            //a.add(new WordBrand(2));
            //a.add(new WordBrand(2));
            //a.add(new WordBrand(2));

            ////a.add(new WordBrand(3));
            //a.add(new WordBrand(3));
            //a.add(new WordBrand(3));
            //a.add(new WordBrand(3));

            f = new Tally();

            Location l = new Location();
            AllPlayers all = new AllPlayers(4, 16);
            WordBrand w = new WordBrand(9);
            WordBrand v = new WordBrand(9);
            w.WhoPush = location.East;
            //v.WhoPush = location.Table;
            all.Show_Table.add(w);
            //all.NowPlayer.add(v);

            f.setPlayer(all);
            f.setPlayer(a);
            //l.next_Winer();
            f.setLocation(l,0);

            f.ShowDialog();
        }