예제 #1
0
파일: Player.cs 프로젝트: weimingtom/mywar
 public Player(string name)
 {
     _name = name;
     Field = new Field();
 }
예제 #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;
         }
     }
 }
예제 #3
0
파일: Server.cs 프로젝트: weimingtom/mywar
 public void SetField(string playerName, Field field)
 {
     Player player = _players.First<Player>((Player p) => { return p.Name == playerName; });
     player.Field = field;
 }