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); } }
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; }
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; }
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; } }
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; } } }
public DeffendOrder(SeppukuMapTileModel source, int unitCount) : base("Defend", source, source, unitCount, 0) { }
public MoveOrder(SeppukuMapTileModel source, SeppukuMapTileModel destination, int unitCount) : base("Move", source, destination, unitCount, 0) { }
public MoveOrder(SeppukuMapTileModel source, SeppukuMapTileModel destination, int unitCount) : base("Move",source,destination,unitCount,0) { }
public GatherOrder(SeppukuMapTileModel source, int unitCount) : base("Gather", source, source, unitCount, 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; }
public BuyOrder(SeppukuMapTileModel source, int count) : base("Buy", source, source, count, 100 * count) { }