public Player(string name) { _name = name; Field = new Field(); }
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; } } }
public void SetField(string playerName, Field field) { Player player = _players.First<Player>((Player p) => { return p.Name == playerName; }); player.Field = field; }