public PlayerTableRow(Map map, Player ply) { _player = ply; _map = map; // player is currently visible? Cells.Add(VillageTableRow.GetVisibleImageCell(_map, _player)); Cells.Add(ColumnDisplay.CreatePlayerCell(ply)); string tribe = ply.HasTribe ? ply.Tribe.Tag : string.Empty; if (ply.TribeChange && ply.PreviousPlayerDetails.Tribe != null) { Cells.Add(ColumnDisplay.CreateDifferenceCell(ply.PreviousPlayerDetails.Tribe.Tag)); } else { Cells.Add(new Cell()); } Cells.Add(new Cell(tribe) { ToolTipText = ply.HasTribe ? ply.Tribe.Tooltip : "" }); Cells.Add(new Cell(ply.Points)); if (ply.PreviousPlayerDetails != null) { Cells.Add(ColumnDisplay.CreateDifferenceCell(ply.Points - ply.PreviousPlayerDetails.Points)); } else { Cells.Add(new Cell()); } Cells.Add(new Cell(ply.Villages.Count)); if (ply.PreviousPlayerDetails != null) { Cells.Add(new Cell(ply.ConquerString)); } else { Cells.Add(new Cell()); } }
public TribeTableRow(Map map, Tribe tribe) { Tribe = tribe; _map = map; // player is currently visible? Cells.Add(VillageTableRow.GetVisibleImageCell(_map, tribe)); Cells.Add(new Cell(tribe.Rank)); Cells.Add(new Cell(tribe.Tag) { ToolTipText = tribe.Tooltip }); Cells.Add(new Cell(tribe.Players.Count)); Cells.Add(new Cell(tribe.PlayerDifferenceString)); Cells.Add(new Cell(tribe.AllPoints)); if (tribe.PreviousTribeDetails != null) { Cells.Add(new Cell(tribe.AllPoints - tribe.PreviousTribeDetails.AllPoints)); } else { Cells.Add(new Cell()); } Cells.Add(new Cell(tribe.Villages)); if (tribe.PreviousTribeDetails != null) { Cells.Add(new Cell(tribe.Villages - tribe.PreviousTribeDetails.Villages)); } else { Cells.Add(new Cell()); } Cells.Add(new Cell(tribe.Name)); }