public static List<MakeStationAction> actionsForPlayer(Player p, Map m) { List<MakeStationAction> results = new List<MakeStationAction>(); foreach (City c in p.cards) { if (p.position == c && m.hasStation(c) == false && m.numStations != numberAllowed) { results.Add(new MakeStationAction(p, c)); } } return results; }
public static List <MakeStationAction> actionsForPlayer(Player p, Map m) { List <MakeStationAction> results = new List <MakeStationAction>(); foreach (City c in p.cards) { if (p.position == c && m.hasStation(c) == false && m.numStations != numberAllowed) { results.Add(new MakeStationAction(p, c)); } } return(results); }
public void update(GameState gs) { Map map = gs.map; //remove labels on map (old) for (int i = 0; i < toRemove.Count; i++) { this.Controls.Remove((Control)toRemove[i]); } toRemove.Clear(); //update disease cubes and research station on cities and player postion int curOffsetY; foreach (City currentCity in map.allCities) { curOffsetY = 1; createDiseaseLabels(currentCity, gs); if (map.hasStation(currentCity)) { makeLabel("STATION", currentCity, 0, curOffsetY, Color.Black, Color.PaleVioletRed); curOffsetY++; } createPlayersLabels(currentCity, gs, curOffsetY); } //current player + last action HUD info makePlayer(gs.currentPlayer().ToString(), .952f, .107f, 0, 0, 2); if (ge.lastAction != null) { //String lastAct = gs.currentPlayer().ToString() + ge.lastAction.ToString(); makeLabel(("Player " + gs.currentPlayer().ToString() + ": " + ge.lastAction.ToString()), .848f, .450f, Color.Green, Color.LightGray, 9); } this.currPlayerInfo.Text = gs.currentPlayer().ToLongDescr(); //other players cards String otherHandstxt = null; int n = 0; foreach (Player p in gs.players) { if (p.playernum != gs.currentPlayerNum) { n = p.playernum + 1; otherHandstxt += "PLAYER " + n + " hand: \n"; foreach (City c in p.cards) { otherHandstxt += c.name + "\n"; } } } this.otherHands.Text = otherHandstxt; //outbreak counter switch (gs.map.outbreakCount) { case 0: makeCounter(false, .023f, .564f); break; case 1: makeCounter(false, .048f, .619f); break; case 2: makeCounter(false, .019f, .658f); break; case 3: makeCounter(false, .048f, .711f); break; case 4: makeCounter(false, .022f, .760f); break; case 5: makeCounter(false, .047f, .790f); break; case 6: makeCounter(false, .019f, .850f); break; case 7: makeCounter(false, .049f, .890f); break; case 8: makeCounter(false, .020f, .931f); break; } //infection counter switch (gs.map.infectionRate) { case 0: makeCounter(true, .505f, .190f); break; case 1: makeCounter(true, .542f, .200f); break; case 2: makeCounter(true, .578f, .214f); break; case 3: makeCounter(true, .616f, .224f); break; case 4: makeCounter(true, .652f, .220f); break; case 5: makeCounter(true, .686f, .210f); break; case 6: makeCounter(true, .723f, .195f); break; } //infection discard deck this.discardInfection.Text = gs.infectionDeck.mostRecent(1)[0].name; //cards left in the player deck makeLabel((gs.playerDeck.drawDeck.Count.ToString() + " cards left"), .537f, .737f, Color.White, Color.Navy); //disease irradicated }