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); } } } }
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); }
private void OnRuleHovered(RuleSlot ruleSlot, bool isHovered) { if (isHovered) { if (ruleSlot == null || ruleSlot.Rule == null) { return; } this.toolTip.ShowTooltip(ruleSlot.Rule.Data.ToString(), ruleSlot.MainRectangle, Tooltip.AnchorPosition.Top, 2); } else { this.toolTip.Hide(); } }