/// <summary> /// 桌面清空 /// </summary> /// <param name="pos"></param> public void Clear(ShowPoint pos) { switch (pos) { case ShowPoint.Desk: Cards.Clear(); CardUI[] cardUIs = CreatePoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIs.Length; i++) { cardUIs[i].Destroy(); } break; case ShowPoint.Player: PlayerCardList.Clear(); CardUI[] cardUIPlayer = PlayerPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIPlayer.Length; i++) { cardUIPlayer[i].Destroy(); } break; case ShowPoint.ComputerRight: ComputerRightCardList.Clear(); CardUI[] cardUIRight = ComputerRightPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUIRight.Length; i++) { cardUIRight[i].Destroy(); } break; case ShowPoint.ComputerLeft: ComputerLeftCardList.Clear(); CardUI[] cardUILeft = ComputerLeftPoint.GetComponentsInChildren <CardUI>(); for (int i = 0; i < cardUILeft.Length; i++) { cardUILeft[i].Destroy(); } break; default: break; } }
/// <summary> /// The constuctor for the MainGameScreen(). Initializes the various local objects/values /// for display purposes. Also, detects whether a player is a spectator and acts accordingly. /// </summary> public MainGameScreen() { BackgroundImage = Engine.TextureList["background720"]; ScreenLocations = new ScreenLocations(); ServerUpdateBox = new ServerUpdateBox(Engine.FontList["updateFont"]); _localPlayer = User.PlayerId; if (Client.isSpectator) { _gameState = GameState.Spectating; _localPlayer = MonsterController.GetDataPackets()[0].PlayerId; } _localMonster = MonsterController.GetById(_localPlayer); _monsterList = GetMonsterList(); _textPrompts = new List <TextBlock>(); _pBlocks = GetPlayerBlocks(); _diceRow = new DiceRow(ScreenLocations.GetPosition("DicePos")); //RollingDice = new DiceRow(ScreenLocations.GetPosition("DicePos")); _rollButton = new RollButton(); playerCardList = new PlayerCardList(); }
public virtual void AddCard(Card card, bool selected, ShowPoint pos) { switch (pos) { case ShowPoint.Desk: Cards.Add(card); //***// card.BelongTo = characterType; CreateCardUI(card, Cards.Count - 1, selected, pos); break; case ShowPoint.Player: PlayerCardList.Add(card); //***// card.BelongTo = characterType; CreateCardUI(card, PlayerCardList.Count - 1, selected, pos); break; case ShowPoint.ComputerRight: ComputerRightCardList.Add(card); //***// card.BelongTo = characterType; CreateCardUI(card, ComputerRightCardList.Count - 1, selected, pos); break; case ShowPoint.ComputerLeft: ComputerLeftCardList.Add(card); //***// card.BelongTo = characterType; CreateCardUI(card, ComputerLeftCardList.Count - 1, selected, pos); break; default: break; } }
public GameData(Game game) { challenge = game.getChallenge(); currentGamePhase = game.getCurrentPhase(); currentPlayerRoleKind = game.getCurrentPlayer().getRoleKind(); infectionRateIndex = game.getInfectionIndex(); outBreakRate = game.getOutbreakRate(); remainingResearch = game.getRemainingResearch(); seed = game.seed; BioTerroristVolunteer = game.BioTerroristVolunteer; currentPlayerIndex = game.currentPlayerIndex; difficulity = game.nEpidemicCard; playerCardDeck = game.getPlayerCardDeckString(); playerDiscardPile = game.getPlayerDiscardPileString(); infectionCardDeck = game.getInfectionDeckString(); infectionDiscardPile = game.getInfectionDiscardPileString(); allHandCards = game.getAllHandCards(); EpidemicCardIntList = EpidemicCard.getEpidemicCard().getIntList(); foreach (City city in game.getCities()) { CityInfo cityInfo = new CityInfo(city); CityInfoList.Add(cityInfo); } foreach (KeyValuePair <Color, Disease> entry in game.getDiseases()) { diseaseInfoList.Add(new DiseaseInfo(entry.Value)); } foreach (Player player in game.getPlayers()) { PlayerCardList playerHand = new PlayerCardList(); mobileHospitalActivated.Add(player.getMobileHospitalActivated()); if (player.getRoleKind() == RoleKind.ContingencyPlanner && player.getEventCardOnTopOfRoleCard() != null) { eventCardOnTopOfRoleCard = player.getEventCardOnTopOfRoleCard().getName(); } if (player.getRoleKind() == RoleKind.FieldOperative) { FOcubes = player.getAllCubes(); } hasCommercialTravelBanInfrontOfPlayer.Add(player.hasEventCardInFront()); //CommercialTravelBanTurn.Add (player.getCommercialTravelBanTurn()); roleKindList.Add(player.getRoleKind()); foreach (PlayerCard pc in player.getHand()) { if (pc.getType().Equals(CardType.CityCard)) { CityCard cityCard = (CityCard)pc; playerHand.playerHand.Add(cityCard.getName()); //Debug.Log ("City Card: " + cityCard.getName()); } else if (pc.getType().Equals(CardType.EventCard)) { EventCard eventCard = (EventCard)pc; playerHand.playerHand.Add(eventCard.getName()); //Debug.Log ("Event Card: " + eventCard.getEventKind()); } else { InfectionCard infectionCard = (InfectionCard)pc; playerHand.playerHand.Add((infectionCard.getName())); //Debug.Log ("Event Card: " + infectionCard.getName()); } } playerCardList.Add(playerHand); } }