public TradeWithRobotsView(Player player, List <Field> ownedProperties) { InitializeComponent(); ButtonTip.SetToolTip(Cancel, "Mégse cserélek"); ButtonTip.SetToolTip(Trade, "Lelet csere"); this.m_Player = player; this.m_OwnedProperties = ownedProperties; PlayerName.Text = m_Player.Name; foreach (Field field in m_OwnedProperties) { if (field.StartedField) { if (field.FieldOwner == player) { PlayerStartedProperties.Items.Add(field); } else { RobotsStartedProperties.Items.Add(field); } } } }
public Settings(Player Player, Robot Robot1, Robot Robot2, Robot Robot3, Level level) { InitializeComponent(); ButtonTip.SetToolTip(Cancel, "Kilépés a Menübe"); ButtonTip.SetToolTip(SaveSettings, "Mentés, és kilépés a menübe"); this.player = Player; this.robot1 = Robot1; this.robot2 = Robot2; this.robot3 = Robot3; this.m_Level = level; foreach (var llevels in Enum.GetValues(typeof(Figure))) { LevelSelection.Items.Add(llevels); } foreach (var figure in Enum.GetValues(typeof(Figure))) { PlayerFigureColor.Items.Add(figure); Robot1FigureColor.Items.Add(figure); Robot2FigureColor.Items.Add(figure); Robot3FigureColor.Items.Add(figure); } FillTheSettingsNodes(); }
public StealPassiveAbilityFromRobotsView(Player player, Robot robot1, Robot robot2, Robot robot3) { InitializeComponent(); ButtonTip.SetToolTip(Cancel, "Mégse lopok"); ButtonTip.SetToolTip(Steal, "Lelet lopás"); this.m_Player = player; this.m_Robot1 = robot1; this.m_Robot2 = robot2; this.m_Robot3 = robot3; PlayerName.Text = m_Player.Name; foreach (CardModelFromDatabase.PassiveCard Card in m_Robot1.MyPassiveCards) { RobotsPassiveCards.Add(Card); } foreach (CardModelFromDatabase.PassiveCard Card in m_Robot2.MyPassiveCards) { RobotsPassiveCards.Add(Card); } foreach (CardModelFromDatabase.PassiveCard Card in m_Robot3.MyPassiveCards) { RobotsPassiveCards.Add(Card); } foreach (CardModelFromDatabase.PassiveCard card in RobotsPassiveCards) { RobotsPassiveAbilities.Items.Add(card); } }
public GameRulesView() { InitializeComponent(); richTextBox1.SelectAll(); richTextBox1.SelectionProtected = true; ButtonTip.SetToolTip(OK, "Kilépés a Menübe"); }
public PropertyCard(Player player, Cards card) { InitializeComponent(); ButtonTip.SetToolTip(Cancel, "Nem veszem meg"); ButtonTip.SetToolTip(Ok, "Lelet megvásárlása"); this.m_Player = player; this.m_Cards = card; Random randomCard = new Random(); int randomCardNumber = randomCard.Next(0, m_Cards.PropertyCards.Count); PlayerOrRobotName.Text = player.Name; for (int i = 0; i < m_Cards.PropertyCards.Count; i++) { if (i == randomCardNumber) { CardText.Text = "Gratulálok! Felfedeztél egy " + m_Cards.PropertyCards[i].PropertyName + "-t."; TurnText.Text = "A feltárásának idelye: " + m_Cards.PropertyCards[i].BuildingTurns + " kör."; FinishedValue.Text = "Ammennyiben elvégezted " + m_Cards.PropertyCards[i].PropertyFinishedValue + "$-t kapsz."; Price.Text = m_Cards.PropertyCards[i].PropertyValue + "$"; if (player.Balance >= m_Cards.PropertyCards[i].PropertyValue) { FieldFinishedValue = m_Cards.PropertyCards[i].PropertyFinishedValue; FieldValue = m_Cards.PropertyCards[i].PropertyValue; FieldName = m_Cards.PropertyCards[i].PropertyName; FieldBuildingTurns = m_Cards.PropertyCards[i].BuildingTurns; m_Player.MyPropertyCards.Add(m_Cards.PropertyCards[i]); m_Cards.PropertyCards.RemoveAt(i); } else { MessageBox.Show("Sajnáljuk nincs elég Pénezd!", "Bank", MessageBoxButtons.OK); Ok.Enabled = false; } } } }
public BoardGame(GameHandler gameHandler, Level level) { InitializeComponent(); m_GameHandler = gameHandler; m_Level = level; player = gameHandler.player; robot1 = gameHandler.robot1; robot2 = gameHandler.robot2; robot3 = gameHandler.robot3; m_ActionControl = new ActionControl(m_GameHandler, this); m_UpdateListBoxes = new UpdateListBoxes(m_GameHandler, this); m_NewTurnHelper = new NewTurnHelper(m_GameHandler, this); m_RobotTurns = new RobotsTurn(m_GameHandler, this, m_NewTurnHelper, m_UpdateListBoxes, m_Level); m_CalculateNextPlayer = new CalculateNextPlayer(m_RobotTurns, m_GameHandler, this, m_NewTurnHelper); FieldLabel = new Label[] { l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, l25, l26, l27, l28, l29, l30, l31, l32, l33, l34, l35, l36, l37, l38, l39 }; FieldLabelOwner = new Label[] { WhoHaveThis0, WhoHaveThis1, WhoHaveThis2, WhoHaveThis3, WhoHaveThis4, WhoHaveThis5, WhoHaveThis6, WhoHaveThis7, WhoHaveThis8, WhoHaveThis9, WhoHaveThis10, WhoHaveThis11, WhoHaveThis12, WhoHaveThis13, WhoHaveThis14, WhoHaveThis15, WhoHaveThis16, WhoHaveThis17, WhoHaveThis18, WhoHaveThis19, WhoHaveThis20, WhoHaveThis21, WhoHaveThis22, WhoHaveThis23, WhoHaveThis24, WhoHaveThis25, WhoHaveThis26, WhoHaveThis27, WhoHaveThis28, WhoHaveThis29, WhoHaveThis30, WhoHaveThis31, WhoHaveThis32, WhoHaveThis33, WhoHaveThis34, WhoHaveThis35, WhoHaveThis36, WhoHaveThis37, WhoHaveThis38, WhoHaveThis39 }; Field = new PictureBox[] { Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13, Field14, Field15, Field16, Field17, Field18, Field19, Field20, Field21, Field22, Field23, Field24, Field25, Field26, Field27, Field28, Field29, Field30, Field31, Field32, Field33, Field34, Field35, Field36, Field37, Field38, Field39 }; PlayerBox.Text = player.Name; Robot1Box.Text = robot1.Name; Robot2Box.Text = robot2.Name; Robot3Box.Text = robot3.Name; PlayerBalance.Text = player.Balance.ToString(); Robot1Balance.Text = robot1.Balance.ToString(); Robot2Balance.Text = robot2.Balance.ToString(); Robot3Balance.Text = robot3.Balance.ToString(); ButtonTip.SetToolTip(Exit, "Kilépés a menübe"); ButtonTip.SetToolTip(ThrowWithTheCubes, "Dobás a kockákkal"); ButtonTip.SetToolTip(DrawTheCard, "Kártya felhúzása"); ButtonTip.SetToolTip(LetsDoIt, "Ásatás elvégzése"); ButtonTip.SetToolTip(EndTurn, "Végeztél a köröddel"); ButtonTip.SetToolTip(TradePropertyCard, "Lelet csere"); ButtonTip.SetToolTip(StealPassiveAbility, "Képesség lopás"); }
public NavigationMenu() { InitializeComponent(); player = new Player("", 0, 0, 0); robot1 = new Robot("", 1, 0, 0); robot2 = new Robot("", 2, 0, 0); robot3 = new Robot("", 3, 0, 0); level = new Level(); if (File.Exists("UserSettings.xml")) { WriteOrReadXMLFile.ImportData(player, robot1, robot2, robot3, level); } else { WriteOrReadXMLFile.ImportDefaultSettings(player, robot1, robot2, robot3, level); } ButtonTip.SetToolTip(GoToTheGame, "Játék"); ButtonTip.SetToolTip(GoToSettings, "Beállítások"); ButtonTip.SetToolTip(GoToRules, "Játékszabályzat"); ButtonTip.SetToolTip(Exit, "Kilépés a Windowsba"); }
//TODO useless limit validation //bool ValidateLimit(ButtonTip tip) //{ // if (tip == ButtonTip.Call || tip == ButtonTip.Raise || tip == ButtonTip.Bet) // { // //if (!MyBalance.IsValid) // // return false; // //impossible // if (Bank.CallValueValid && !Bank.RaiseValueValid) // { // if (Bank.CallValue <= BuyIn) // return true; // return false; // } // //bet or all-in // if (!Bank.CallValueValid && Bank.RaiseValueValid) // { // if (Bank.RaiseValue <= BuyIn) // return true; // return false; // } // //call & raise // if (Bank.CallValueValid && Bank.RaiseValueValid) // { // if (tip == ButtonTip.Call) // { // if (Bank.CallValue <= BuyIn) // return true; // return false; // } // if (tip == ButtonTip.Raise) // { // if (Bank.RaiseValue <= BuyIn) // return true; // return false; // } // if (tip == ButtonTip.Bet) // { // if (Bank.RaiseValue <= BuyIn) // return true; // return false; // } // return false; // } // } // return true; //} bool Click(ButtonTip tip, bool validateLimit) { PlayerActionCounter += 1; //TODO useless limit validation ////if (validateLimit) //{ // var lim = ValidateLimit(tip); // if (!lim) // { // var msg = Algo + ":" + tip.ToString() + ";out of limit:" + MyBalance.Posa + ";" + Bank.CallValue + ";" + Bank.RaiseValue; // Ex.Info(msg); // if (ClickLogDebug != null) // { // ClickLogDebug(DateTime.Now.ToString("HH:mm:ss") + msg); // } // return false; // } //} Button bt = null; foreach (Button button in Buttons) { if (button.Tip == tip) { bt = button; break; } } if (bt != null) { if ((bt.Tip == ButtonTip.Bet || bt.Tip == ButtonTip.Raise || bt.Tip == ButtonTip.Call)) { IsFreePlay = false; } //var rnd = new Random(); var rect = bt.Rect; var rndValX = _random.Next(rect.Width / 6, rect.Width - rect.Width / 6); var rndValY = _random.Next(rect.Height / 6, rect.Height - rect.Height / 6); var x = WindowPoint.X + rect.X + rndValX; var y = WindowPoint.Y + rect.Y + rndValY; //var x = WindowPoint.X + rect.X + Add + rndValX; //var y = WindowPoint.Y + rect.Y + Add + rndValY; if (ClickLog != null) { ClickLog(Algo + ":" + tip.ToString()); } WinApi.ClickOnPoint(IntPtr.Zero, new Point(x, y)); //User simulation if (RandomTableRect != Rectangle.Empty) { //var rndXX = _random.Next(RandomTableRect.Width / 10, RandomTableRect.Width); var rndXX = _random.Next(bt.Rect.Width / 10, bt.Rect.Width); var rndYY = _random.Next(RandomTableRect.Height / 10, RandomTableRect.Height); var x1 = WindowPoint.X + rndXX + bt.Rect.X; var y1 = WindowPoint.Y + rndYY + RandomTableRect.Y; WinApi.MoveOnPoint(IntPtr.Zero, new Point(x1, y1)); } //End user simulation if (AfterClickLog != null) { AfterClickLog(Algo + ":" + tip.ToString()); } return true; } return false; }