private void OnPlayRuleHover(BorderComponent component, bool hovered) { RuleSlot slot = component.gameObject.GetComponent <RuleSlot>(); if (currentState != State.CardPlacement || slot.Rule == null || !hovered) { for (int index = 0; index < this.playSlots.Length; ++index) { this.playSlots[index].ResetBorderColor(); } return; } for (int x = 0; x < GameController.GridSize; ++x) { for (int y = 0; y < GameController.GridSize; ++y) { int slotIndex = y * GameController.GridSize + x; if (slot.Rule.Data.IsSlotAllowed(ref this.nextPlayedCard.Data, this.playSlots, x, y)) { this.playSlots[slotIndex].SetBorderColor(Color.green); } else { this.playSlots[slotIndex].SetBorderColor(Color.red); } } } }
private void OnRetryPressed(BorderComponent button, bool ison) { MainManager mainManager = MainManager.Instance; if (mainManager == null) { return; } mainManager.RequestRestart(); }
public void OnPlayMatCardPressed(BorderComponent slot, bool isOn) { if (this.currentState != State.CardPlacement) { return; } CardSlot cardSlot = (CardSlot)slot; PlayCard(cardSlot.Index); }
public void OnHandRulePressed(BorderComponent slot, bool isOn) { if (this.currentState != State.CardRuleChoice) { return; } RuleSlot ruleSlot = (RuleSlot)slot; this.SelectHandRule(ruleSlot.Index); this.SelectRandomCard(ruleSlot.Index); }
public void OnHandCardPressed(BorderComponent slot, bool isOn) { if (this.currentState != State.CardRuleChoice) { return; } CardSlot cardSlot = (CardSlot)slot; this.SelectCard(cardSlot.Index); this.SelectRandomRule(cardSlot.Index); }
public void OnHandRuleHovered(BorderComponent slot, bool on) { }