public ucRecieveItem(Player user, Character character, Control motherControl, frmGame mainForm) { InitializeComponent(); User = user; RecievedFrom = character; RecievedItem = character.SatisfactionItem; MotherControl = motherControl; MainForm = mainForm; this.Left = (MainForm.Width - this.Width) / 2; this.Top = (MainForm.Height - this.Height) / 2; lblRecievedItem.Text = "Recieved " + RecievedItem.Name.ToLower() + "\nfrom " + RecievedFrom.Name; picRecievedItem.Image = RecievedItem.Image; }
private void btnNuevaPartida_Click(object sender, EventArgs e) { bool value = AlertBox.Question("Al crear una nueva partida la partida guardada se borrará\n¿Estás seguro que deseas crear una nueva partida?", "red"); if (value) { string game = AlertBox.Input("Ingresa el nombre de tu nueva partida"); if (game != "" && game != null) { if (game.Length > 3) { if (game.Length < 21) { AlertBox.Notify("Creando partida...", true, "blue"); //OleDbConnection cn = new OleDbConnection(); //cn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=LaManzanitaDB.accdb"; //cn.Open(); frmGame FrmGame = new frmGame(); FrmGame.lblNameAccount.Text = game; FrmGame.Show(); FrmGame = null; Lib.PlaySound("Billards.wav"); //OleDbCommand cmd = new OleDbCommand(); //cmd.CommandText = "UPDATE tblAcccount SET NameAccount='" + game + "', Money=10, GoldCoins=0, SilverCoins=0, cantNuevoTiro=0, cantWinCereza=0, cantWinApple=0, cantWinOrange=0, cantWinPera=0, cantWinAnana=0, cantWinBanana=0, cantWinStar=0, cantWinBAR50=0, cantWinBAR100=0, cantLosCereza=0, cantLosApple=0, cantLosOrange=0, cantLosPera=0, cantLosAnana=0, cantLosBanana=0, cantLosStar=0, cantLosBAR50=0, cantLosBAR100=0, cantWinGoldCoinsCereza=0, cantWinGoldCoinsApple=0, cantWinGoldCoinsOrange=0, cantWinGoldCoinsPera=0, cantWinGoldCoinsAnana=0, cantWinGoldCoinsBanana=0, cantWinGoldCoinsStar=0, cantWinGoldCoinsBAR50=0, cantWinGoldCoinsBAR100=0, cantWinSilverCoinsCereza=0, cantWinSilverCoinsApple=0, cantWinSilverCoinsOrange=0, cantWinSilverCoinsPera=0, cantWinSilverCoinsAnana=0, cantWinSilverCoinsBanana=0, cantWinSilverCoinsStar=0, cantWinSilverCoinsBAR50=0, cantWinSilverCoinsBAR100=0"; //cmd.ExecuteNonQuery(); //cmd = null; this.Dispose(); AlertBox.Notify("¡Partida creada con éxito!", true); } else { AlertBox.Notify("El nombre debe tener hasta 20 caracteres"); } } else { AlertBox.Notify("El nombre debe tener al menos 4 caracteres"); } } else if (game != null) { AlertBox.Notify("La partida debe tener un nombre"); } } }
public void Open(Player User, Room room, ContainerItem containerItem, ContainerItem motherItem, frmGame mainForm) { if (containerItem.IsLocked) { mainForm.PlayerThinking("This " + containerItem.Name.ToLower() + " is locked"); } else { mainForm.OpenItem(User, containerItem); } }
public static void GameStart(){ frmGame form = new frmGame(); //Point 3 }
private void cmdNewGame_Click(object sender, EventArgs e) { frmGame frmGame = new frmGame(); frmGame.Show(); }
public static void ResetAll() { if (_frmBattle != null) { _frmBattle.Close(); _frmBattle = null; } if (_frmMap != null) { _frmMap.Close(); _frmMap = null; } if (_frmGame != null) { _frmGame.Close(); _frmGame = null; } _isServer = false; _me = null; _server = null; _players.Clear(); _currentPlayer = null; _isNeedToStartGame = false; _isGameStarted = false; _isInitialized = false; _isAllPlayerInitialized = false; _needToRunNextPlayer = false; _isNeedToStartBattle = false; _amIBattle = false; _isBattleStarted = false; _attackPlayer = null; _attackHero = null; _attackArmies = null; _defendPlayer = null; _defendHero = null; _defendCastle = null; _defendArmies = null; _victory = 0; _isBattleEnded = false; _attackCommands.Clear(); _defendCommands.Clear(); }
// progress bluetooth communication using Serial communication. public SerialCommunication(frmGame frm, string portName, SerialDataReceivedHandler handler) { this.frmGame = frm; this.portName = portName; this.serialDataReceivedHandler = handler; }