Exemplo n.º 1
0
		public MainPage(SeppukuModel model): this()
		{
			//this.playerName = playerName;
			this.MapWithScroll.MapTiles.initWithModel(model.map);
			this.OrdersList.initWithModel(model);
			this.KingdomPanel.initWithModel(model);
		}
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
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();
			}
		}
Exemplo n.º 4
0
		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));
			}
		}
Exemplo n.º 5
0
        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));
            }
        }
Exemplo n.º 6
0
		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;
		}
Exemplo n.º 7
0
		public override void undoChanges(SeppukuModel model)
		{
			Source.Gatherers = Source.Gatherers + UnitCount;
			base.undoChanges(model);
		}
Exemplo n.º 8
0
 public override void undoChanges(SeppukuModel model)
 {
     Source.Gatherers = Source.Gatherers + UnitCount;
     base.undoChanges(model);
 }
Exemplo n.º 9
0
		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);
		}
Exemplo n.º 10
0
		public void initWithModel(SeppukuModel model)
		{
			this.model = model;
			this.OrderList.ItemsSource = model.Orders;
		}
Exemplo n.º 11
0
		public override void undoChanges(SeppukuModel model)
		{
			model.RiceNumber += 100 * UnitCount;
			base.undoChanges(model);
		}