public MainPage(SeppukuModel model) : this() { //this.playerName = playerName; this.MapWithScroll.MapTiles.initWithModel(model.map); this.OrdersList.initWithModel(model); this.KingdomPanel.initWithModel(model); }
private void Application_Startup(object sender, StartupEventArgs e) { if (e.InitParams.Keys.Contains("playerId")) { SeppukuModel model = new SeppukuModel(Convert.ToInt32(e.InitParams["playerId"])); model.Ready += this.onReady; } else { this.RootVisual = new MainPage(); } }
public void initWithModel(SeppukuModel model) { this.model = model; int tileNumber = 0; int manCount = 0; foreach (SeppukuMapTileModel tileModel in model.map.tiles) { if (tileModel.owner != null && tileModel.owner.id == model.currentPlayerId) { tileNumber++; manCount += tileModel.Gatherers; } } this.PlayerFlag.Fill = new SolidColorBrush(this.model.players[this.model.currentPlayerId].color); this.TileNumber.Text = tileNumber.ToString(); this.ManNumber.Text = manCount.ToString(); this.RiceNumber.Text = model.RiceNumber.ToString(); this.model.RiceNumberChanged += this.onRiceNumberChanged; }
public void initWithModel(SeppukuModel model) { this.model = model; this.OrderList.ItemsSource = model.Orders; }