CardDefinition StartEvent() { _eventCards.Push(_startLevelCard); _currentEventState = EVENT_STATE.STATE_EVENT; CardDefinition startLevelCard = new CardDefinition(); startLevelCard.type = CardDefinition.TYPE_EVENT_START_ANIM; startLevelCard.isInitial = "FALSE"; startLevelCard.id = "-1"; startLevelCard.image = "Almo"; startLevelCard.text = "Start the Event. Are you ready?"; var leftDecision = new DecisionInfo(); leftDecision.text = "Come On!"; leftDecision.nextCard = ""; leftDecision.cardsToAdd = new List <string>(); startLevelCard.left = leftDecision; var rightDecision = new DecisionInfo(); rightDecision.text = "Yeah!!"; rightDecision.nextCard = ""; rightDecision.cardsToAdd = new List <string>(); startLevelCard.right = rightDecision; return(startLevelCard); }
CardDefinition StartPostEvent() { AddPostEvents(); _currentEventState = EVENT_STATE.STATE_POST_EVENT; CardDefinition endLevelCard = new CardDefinition(); endLevelCard.type = CardDefinition.TYPE_EVENT_END_ANIM; endLevelCard.isInitial = "FALSE"; endLevelCard.id = "-1"; endLevelCard.image = "Almo"; endLevelCard.text = "The event ended. Yay!"; var leftDecision = new DecisionInfo(); leftDecision.text = "Yeah!"; leftDecision.nextCard = ""; leftDecision.cardsToAdd = new List <string>(); endLevelCard.left = leftDecision; var rightDecision = new DecisionInfo(); rightDecision.text = "Uff!"; rightDecision.nextCard = ""; rightDecision.cardsToAdd = new List <string>(); endLevelCard.right = rightDecision; return(endLevelCard); }
CardDefinition StartLevel() { _currentEventState = EVENT_STATE.STATE_LEVEL; CardDefinition startLevelCard = new CardDefinition(); startLevelCard.type = CardDefinition.TYPE_EVENT_LEVEL_ANIM; startLevelCard.isInitial = "FALSE"; startLevelCard.id = "-1"; startLevelCard.image = "almo"; startLevelCard.text = "Level " + (_currentLevel + 1); var leftDecision = new DecisionInfo(); leftDecision.text = "Go!"; leftDecision.nextCard = ""; leftDecision.cardsToAdd = new List <string>(); startLevelCard.left = leftDecision; var rightDecision = new DecisionInfo(); rightDecision.text = "Go!"; rightDecision.nextCard = ""; rightDecision.cardsToAdd = new List <string>(); startLevelCard.right = rightDecision; return(startLevelCard); }
void LoadLevel() { _currentLevel++; if (_currentLevel > 3) { _currentLevel = 1; } _currentEventState = EVENT_STATE.STATE_PRE_EVENT; _preEventCards.Clear(); _postEventCards.Clear(); _eventCards.Clear(); _levelCards.Clear(); foreach (var card in _allCards.Values) { if (card.level == _currentLevel) { if (card.IsInitial()) { if (card.IsPreEvent()) { _preEventCards.Push(card); } else if (card.IsEventCard()) { _eventCards.Push(card); } else if (card.IsPostEventCard()) { _postEventCards.Push(card); } } else { _levelCards.Add(card.id, card); } if (card.IsStartEvent()) { _startLevelCard = card; } } } _preEventCards = shuffle(_preEventCards); _eventCards = shuffle(_eventCards); }
public Card NextCard() { Debug.Log("num cards " + _preEventCards.Count); var card = obtainNextCard(); Debug.Log("next card " + card.id); var color = RandomColor(card.type); var image = chooseFace(card.image); var name = chooseName(card.image); CurrentCardDefinition = card; CurrentCard = new Card(image: image, color: color, description: card.text, rightText: card.right.text, rightMoney: card.right.money, rightHappiness: card.right.happiness, rightTime: card.right.time, leftText: card.left.text, leftMoney: card.left.money, leftHappiness: card.left.happiness, leftTime: card.left.time, name: name, type: card.type); return(CurrentCard); }