Exemple #1
0
 public Player(string name)
 {
     _name = name;
     Field = new Field();
 }
Exemple #2
0
 private void UpdateField(DataGridView grid, Field field, bool showAll)
 {
     for (int row = 0; row < 10; row++)
     {
         for (int col = 0; col < 10; col++)
         {
             byte cellType = field.Cells[row][col];
             string icon = "";
             if (cellType == Field.Building && showAll)
                 icon = Const.BUILDING_ICON;
             else if (cellType == Field.Fire)
                 icon = Const.FIRE_ICON;
             else if (cellType == Field.Miss)
                 icon = Const.MISS_ICON;
             grid[col, row].Value = icon;
         }
     }
 }
Exemple #3
0
 public void SetField(string playerName, Field field)
 {
     Player player = _players.First<Player>((Player p) => { return p.Name == playerName; });
     player.Field = field;
 }