public Coordinator(MainWindow gameUI) { this.gameUI = gameUI; nickname = ""; hasGame = false; isFreeBuildButtonEnabled = false; /* //prepare the timer timer = new System.Windows.Threading.DispatcherTimer(); timer.Tick += new EventHandler(timer_Tick); timer.Interval = new TimeSpan(0, 0, 1); */ // load the card list using (System.IO.StreamReader file = new System.IO.StreamReader(System.Reflection.Assembly.Load("GameManager"). GetManifestResourceStream("GameManager.7 Wonders Card list.csv"))) { // skip the header line file.ReadLine(); String line = file.ReadLine(); while (line != null && line != String.Empty) { fullCardList.Add(new Card(line.Split(','))); line = file.ReadLine(); } } }
public FinalScore(MainWindow mw, NameValueCollection scores) { InitializeComponent(); mainWindow = mw; FontFamily ourFont = new FontFamily("Lucida Handwriting"); Width = 78 + (scores.Count) * 62; int column = 1; foreach (string s in scores.AllKeys) { ScoreGrid.ColumnDefinitions.Add(new ColumnDefinition()); TextBlock nameElement = new TextBlock() { Text = s, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, FontFamily = ourFont, FontSize = 10, }; Grid.SetRow(nameElement, 0); Grid.SetColumn(nameElement, column); ScoreGrid.Children.Add(nameElement); string[] st = scores[s].Split(','); int row = 1; foreach (string str in scores[s].Split(',')) { TextBlock v = new TextBlock() { Text = str, VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, FontFamily = ourFont, FontSize = 24, }; Grid.SetRow(v, row); Grid.SetColumn(v, column); ScoreGrid.Children.Add(v); ++row; } ++column; } }