public MainPage(SeppukuModel model): this() { //this.playerName = playerName; this.MapWithScroll.MapTiles.initWithModel(model.map); this.OrdersList.initWithModel(model); this.KingdomPanel.initWithModel(model); }
public virtual void undoChanges(SeppukuModel model) { SeppukuServiceSoapClient client = new SeppukuServiceSoapClient(); OrderInfo info = new OrderInfo(); info.orderType = this.Type; info.sourceTileId = this.Source.tileId; info.destinationTileId = this.Destination.tileId; info.unitCount = this.UnitCount; client.removeOrderAsync(info); }
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 SeppukuMapModel(SeppukuModel model, ICollection<TileInfo> tilesInfo) { this.model = model; this.destinationTileFieldMode = false; tiles = new List<SeppukuMapTileModel>(); foreach(TileInfo info in tilesInfo) { Player player = null; if(info.ownerId != null) { if(model.players.ContainsKey((int)info.ownerId)) player = model.players[(int)info.ownerId]; } tiles.Add(new SeppukuMapTileModel(this, info.tileId, info.x, info.y, player, info.name, info.numberOfWorkers)); } }
public SeppukuMapModel(SeppukuModel model, ICollection <TileInfo> tilesInfo) { this.model = model; this.destinationTileFieldMode = false; tiles = new List <SeppukuMapTileModel>(); foreach (TileInfo info in tilesInfo) { Player player = null; if (info.ownerId != null) { if (model.players.ContainsKey((int)info.ownerId)) { player = model.players[(int)info.ownerId]; } } tiles.Add(new SeppukuMapTileModel(this, info.tileId, info.x, info.y, player, info.name, info.numberOfWorkers)); } }
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 override void undoChanges(SeppukuModel model) { Source.Gatherers = Source.Gatherers + UnitCount; base.undoChanges(model); }
public override void undoChanges(SeppukuModel model) { Source.Gatherers = Source.Gatherers + UnitCount; base.undoChanges(model); }
public virtual void undoChanges(SeppukuModel model) { SeppukuServiceSoapClient client = new SeppukuServiceSoapClient(); OrderInfo info = new OrderInfo(); info.orderType = this.Type; info.sourceTileId = this.Source.tileId; info.destinationTileId = this.Destination.tileId; info.unitCount = this.UnitCount; client.removeOrderAsync(info); }
public void initWithModel(SeppukuModel model) { this.model = model; this.OrderList.ItemsSource = model.Orders; }
public override void undoChanges(SeppukuModel model) { model.RiceNumber += 100 * UnitCount; base.undoChanges(model); }