Beispiel #1
0
 public MainPage(SeppukuModel model) : this()
 {
     //this.playerName = playerName;
     this.MapWithScroll.MapTiles.initWithModel(model.map);
     this.OrdersList.initWithModel(model);
     this.KingdomPanel.initWithModel(model);
 }
Beispiel #2
0
 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;
        }
Beispiel #4
0
 public void initWithModel(SeppukuModel model)
 {
     this.model = model;
     this.OrderList.ItemsSource = model.Orders;
 }