Beispiel #1
0
		public PlayableTile(SeppukuMapTiles map, SeppukuMapTileModel model): this()
		{
			this.map = map;
			this.model = model;
			this.model.select += this.onSelect;
			this.model.deselct += this.onDeselect;
			this.model.orderAdded += this.onOrderAdded;
			this.model.orderRemoved += this.onOrderRemoved;
			this.model.orderSelected += this.onOrderSelected;
			this.model.orderDeselected += this.onOrderDeselected;

			if(this.model.owner != null)
			{
				this.Flag.Fill = new SolidColorBrush(this.model.owner.color);
				this.WavingFlag.Begin();
				this.WavingFlag.RepeatBehavior = RepeatBehavior.Forever;
			}
			else
				this.FlagContainer.Visibility = Visibility.Collapsed;

			foreach(IOrder order in this.model.mapModel.model.Orders)
			{
				if(order.Source == this.model)
					this.displayAddedOrder(order);
			}
		}
Beispiel #2
0
        public AbstractOrder(String type, SeppukuMapTileModel source, SeppukuMapTileModel destination, int unitCount, int cost)
        {
            this.Type = type;
            if (type == "Defend")
            {
                this.Image = "Resources/Shield.png";
            }
            else if (type == "Move")
            {
                this.Image = "Resources/Leg.png";
            }
            else if (type == "Buy")
            {
                this.Image = "Resources/money.png";
            }
            else if (type == "Gather")
            {
                this.Image = "Resources/gather.png";
            }


            this.Source      = source;
            this.Destination = destination;
            this.UnitCount   = unitCount;
            this.orderCost   = cost;
        }
Beispiel #3
0
		public void displayTile(SeppukuMapTileModel tile)
		{
			TileName.Text = tile.name;
			TileNameContainer.Visibility = Visibility.Visible;
			if(tile.owner != null)
			{
				PlayerName.Text = tile.owner.name;
				PlayerNameContainer.Visibility = Visibility.Visible;
			}
			Workers.Text = tile.Gatherers.ToString();
			WorkersContainer.Visibility = Visibility.Visible;
		}
Beispiel #4
0
		public void tileAction(SeppukuMapTileModel model)
		{
			if(destinationTileFieldMode)
			{
				this.DestinationTileFieldMode = false;
				if(Math.Abs(model.x - tileSelected.x) + Math.Abs(model.y - tileSelected.y) == 1)
				{
					this.model.addOrder(new MoveOrder(this.tileSelected, model, SelectedPopulation));
				}
			}
			else
			{
				if(model.owner != null && model.owner.id == this.model.currentPlayerId)	
					this.TileSelected = model;
				else
					this.TileSelected = null;
			}
		}
Beispiel #5
0
 public void tileAction(SeppukuMapTileModel model)
 {
     if (destinationTileFieldMode)
     {
         this.DestinationTileFieldMode = false;
         if (Math.Abs(model.x - tileSelected.x) + Math.Abs(model.y - tileSelected.y) == 1)
         {
             this.model.addOrder(new MoveOrder(this.tileSelected, model, SelectedPopulation));
         }
     }
     else
     {
         if (model.owner != null && model.owner.id == this.model.currentPlayerId)
         {
             this.TileSelected = model;
         }
         else
         {
             this.TileSelected = null;
         }
     }
 }
Beispiel #6
0
		public DeffendOrder(SeppukuMapTileModel source, int unitCount) : base("Defend", source, source, unitCount, 0)
		{
			
		}
Beispiel #7
0
 public DeffendOrder(SeppukuMapTileModel source, int unitCount) : base("Defend", source, source, unitCount, 0)
 {
 }
Beispiel #8
0
 public MoveOrder(SeppukuMapTileModel source, SeppukuMapTileModel destination, int unitCount) : base("Move", source, destination, unitCount, 0)
 {
 }
Beispiel #9
0
		public MoveOrder(SeppukuMapTileModel source, SeppukuMapTileModel destination, int unitCount) : base("Move",source,destination,unitCount,0)
		{

		}
Beispiel #10
0
 public GatherOrder(SeppukuMapTileModel source, int unitCount) : base("Gather", source, source, unitCount, 0)
 {
 }
Beispiel #11
0
		public GatherOrder(SeppukuMapTileModel source, int unitCount) : base("Gather", source, source, unitCount, 0)
		{
			
		}
Beispiel #12
0
		public AbstractOrder(String type, SeppukuMapTileModel source, SeppukuMapTileModel destination, int unitCount, int cost)
		{
			this.Type = type;
			if(type == "Defend")
			{
				this.Image = "Resources/Shield.png";
			}
			else if(type == "Move")
			{
				this.Image = "Resources/Leg.png";
			}
			else if(type == "Buy")
			{
				this.Image = "Resources/money.png";
			}
			else if(type == "Gather")
			{
				this.Image = "Resources/gather.png";
			}
			

			this.Source = source;
			this.Destination = destination;
			this.UnitCount = unitCount;
			this.orderCost = cost;
		}
Beispiel #13
0
		public BuyOrder(SeppukuMapTileModel source, int count) : base("Buy", source, source, count, 100 * count)
		{
			
		}