예제 #1
0
 /// <summary>
 /// Start a new game
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void новаяИграMenuItem_Click(object sender, EventArgs e)
 {
     ApplySettings();
     State_SetStartPosition(Properties.Resources.start_position);
     _mouseHandler = new MouseClickHandler(screen, ref _state);
     _mouseHandler.ShowTurnOwnerMessage();
 }
예제 #2
0
        /// <summary>
        /// Loading game
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void загрузитьИгруToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = Program.LocalizedText.menu.binaryFile + "|*.bin";
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    State_Deserialize(ofd.FileName);
                    _mouseHandler = new MouseClickHandler(screen, ref _state);
                    screen.Invalidate();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(Program.LocalizedText.menu.fileCorrupted + ex.Message);
                }
            }
            _mouseHandler.ShowTurnOwnerMessage();
        }