Ejemplo n.º 1
0
        public GameForm(GameClient client)
        {
            this.client = client;

            InitializeComponent();

            profile1.Region = Region.FromHrgn(CreateRoundRectRgn(1, 1, profile1.Width, profile1.Height, 15, 25));
            profile2.Region = Region.FromHrgn(CreateRoundRectRgn(1, 1, profile2.Width, profile2.Height, 15, 25));
            profile3.Region = Region.FromHrgn(CreateRoundRectRgn(1, 1, profile3.Width, profile3.Height, 15, 25));
            profile4.Region = Region.FromHrgn(CreateRoundRectRgn(1, 1, profile4.Width, profile4.Height, 15, 25));

            tileGridPanels.Add(tgpTable);
            tileGridPanels.Add(tgpHolding);

            tgpTable.TileSize = new Size(36, 48);
            tgpTable.SetCapacity(15, 6);
            tgpTable.OnPlace  += (tile, i, j) => client.UpdateTable(tgpTable.GetTileTable());
            tgpTable.OnPickup += (tile, i, j) => client.UpdateTable(tgpTable.GetTileTable());

            tgpHolding.TileSize = new Size(36, 48);
            tgpHolding.SetCapacity(15, 2);
            tgpHolding.OnPlace           += (tile, i, j) => client.UpdatePrivateTiles(tgpHolding.GetTileList());
            tgpHolding.OnPickup          += (tile, i, j) => client.UpdatePrivateTiles(tgpHolding.GetTileList());
            tgpHolding.OptionRemoveSpaces = false;

            profile1.Visible     = false;
            profile2.Visible     = false;
            profile3.Visible     = false;
            profile4.Visible     = false;
            btn_complete.Visible = false;
            btn_return.Visible   = false;
        }