示例#1
0
        protected virtual void Window_Loaded(object sender, RoutedEventArgs e)
        {
            BackgroundColor = inactiveBackground;

            ownField   = new PlayField(window.OwnFieldCanvas);
            enemyField = new PlayField(window.EnemyFieldCanvas);

            Round    = 0;
            HitCount = 0;
            window.maxhitcount.Text = Ships.Sum(x => x.Size).ToString();

            Ready = true;
        }
 private Cell GetRandomCell(PlayField field)
 {
     return(field[random.Next(PlayField.RowCount), random.Next(PlayField.ColumnCount)]);
 }